[cmucl-commit] [git] CMU Common Lisp branch master updated. begin-x87-removal-9-gd3bc3ac

Raymond Toy rtoy at common-lisp.net
Sun Apr 13 18:25:31 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".

The branch, master has been updated
       via  d3bc3ac7a83c9c06dabf37ebe9e781bcfcfa5518 (commit)
       via  f94c7fc82bcfc0da0906ac64891f22e2eca169ae (commit)
       via  6bba234d4dc71255cf4b9c6a0d418147781c564b (commit)
      from  260d94f1a9057fb9ae592a0b7b898f881316f289 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d3bc3ac7a83c9c06dabf37ebe9e781bcfcfa5518
Author: Raymond Toy <toy.raymond at gmail.com>
Date:   Sun Apr 13 11:25:11 2014 -0700

    Remove commented code and some redundant jmps.

diff --git a/src/lisp/x86-assem.S b/src/lisp/x86-assem.S
index fd52d39..f3b4344 100644
--- a/src/lisp/x86-assem.S
+++ b/src/lisp/x86-assem.S
@@ -117,13 +117,6 @@ FUNCDEF(call_into_lisp)
 	movl	%esp,%ebp	# establish new frame
 
 /* Save the NPX state */
-#if 0
-	fwait			# Catch any pending NPX exceptions.
-	/* Save the SSE2 for X87 state */
-	mov	GNAME(fpu_mode), %eax
-	cmp	$2, %eax	# SSE2 mode?
-	jne	x87_save
-#endif
 	movl	%esp, %eax	# Remember the current stack pointer
 	/*
 	 * The SSE state is 512 bytes, but we need 16 more because we
@@ -133,25 +126,6 @@ FUNCDEF(call_into_lisp)
 	andl	$-16, %esp	# fxsave needs 16-byte alignment
 	fxsave	(%esp)		
 	pushl	%eax		# Save the old stack pointer
-	fninit			# Reset fpu, just in case
-	jmp	npx_save_done
-#if 0
-x87_save:
-	subl	$108,%esp	# Make room for the NPX state.
-	fnsave	(%esp)		# Resets NPX
-		
-	movl	(%esp),%eax	# Load NPX control word
-	andl	$0xfffff3ff,%eax	# Set rounding mode to nearest
-#ifdef type_LongFloat
-	orl	$0x00000300,%eax	# Set precision to 64 bits
-#else
-	orl	$0x00000200,%eax	# Set precision to 53 bits
-#endif	
-	pushl	%eax
-	fldcw	(%esp)		# Recover modes
-	popl	%eax
-#endif
-npx_save_done:			
 /* Save C regs: ebx esi edi */
 	pushl	%ebx
 	pushl	%esi
@@ -219,22 +193,9 @@ Ldone:
 	popl	%ebx
 
 /* Restore the NPX state */
-#if 0
-	/* Restore SSE2 state? */
-	mov	GNAME(fpu_mode), %eax
-	cmp	$2, %eax	# SSE2 mode?
-	jne	x87_restore
-#endif
 	popl	%eax		# Get the old stack pointer
 	fxrstor	(%esp)		# Restore the SSE state
 	movl	%eax, %esp	# Now really restore the old stack pointer
-	jmp	npx_restore_done
-#if 0
-x87_restore:
-	frstor  (%esp)
-	addl	$108, %esp
-#endif
-npx_restore_done:	
 			
 	popl	%ebp		# c-sp
 	movl	%edx,%eax	# c-val

commit f94c7fc82bcfc0da0906ac64891f22e2eca169ae
Author: Raymond Toy <toy.raymond at gmail.com>
Date:   Sun Apr 13 10:59:47 2014 -0700

    Comment out x87 stuff from call_into_lisp.

diff --git a/src/lisp/x86-assem.S b/src/lisp/x86-assem.S
index f9dee43..fd52d39 100644
--- a/src/lisp/x86-assem.S
+++ b/src/lisp/x86-assem.S
@@ -117,11 +117,13 @@ FUNCDEF(call_into_lisp)
 	movl	%esp,%ebp	# establish new frame
 
 /* Save the NPX state */
+#if 0
 	fwait			# Catch any pending NPX exceptions.
 	/* Save the SSE2 for X87 state */
 	mov	GNAME(fpu_mode), %eax
 	cmp	$2, %eax	# SSE2 mode?
 	jne	x87_save
+#endif
 	movl	%esp, %eax	# Remember the current stack pointer
 	/*
 	 * The SSE state is 512 bytes, but we need 16 more because we
@@ -133,7 +135,7 @@ FUNCDEF(call_into_lisp)
 	pushl	%eax		# Save the old stack pointer
 	fninit			# Reset fpu, just in case
 	jmp	npx_save_done
-
+#if 0
 x87_save:
 	subl	$108,%esp	# Make room for the NPX state.
 	fnsave	(%esp)		# Resets NPX
@@ -148,6 +150,7 @@ x87_save:
 	pushl	%eax
 	fldcw	(%esp)		# Recover modes
 	popl	%eax
+#endif
 npx_save_done:			
 /* Save C regs: ebx esi edi */
 	pushl	%ebx
@@ -216,17 +219,21 @@ Ldone:
 	popl	%ebx
 
 /* Restore the NPX state */
+#if 0
 	/* Restore SSE2 state? */
 	mov	GNAME(fpu_mode), %eax
 	cmp	$2, %eax	# SSE2 mode?
 	jne	x87_restore
+#endif
 	popl	%eax		# Get the old stack pointer
 	fxrstor	(%esp)		# Restore the SSE state
 	movl	%eax, %esp	# Now really restore the old stack pointer
 	jmp	npx_restore_done
+#if 0
 x87_restore:
 	frstor  (%esp)
 	addl	$108, %esp
+#endif
 npx_restore_done:	
 			
 	popl	%ebp		# c-sp

commit 6bba234d4dc71255cf4b9c6a0d418147781c564b
Author: Raymond Toy <toy.raymond at gmail.com>
Date:   Sat Apr 12 18:10:46 2014 -0700

    More x87 removal from sse2-c-call.lisp
    
     * Remove frobbing of the FPU modes from alloc and dealloc.
     * Use 16-byte alignment for all platforms. It's harmless for those
       that don't require it.

diff --git a/src/compiler/x86/sse2-c-call.lisp b/src/compiler/x86/sse2-c-call.lisp
index 83f21b5..1e827d3 100644
--- a/src/compiler/x86/sse2-c-call.lisp
+++ b/src/compiler/x86/sse2-c-call.lisp
@@ -71,19 +71,11 @@
   (:generator 0
     (assert (location= result esp-tn))
 
-    #+(or linux)
-    (progn
-      ;; Is this needed with sse2?
-      (inst sub esp-tn 4)
-      (inst fnstcw (make-ea :word :base esp-tn))
-      (inst and (make-ea :word :base esp-tn) #xcff)
-      (inst or (make-ea :word :base esp-tn) #x300)
-      (inst fldcw (make-ea :word :base esp-tn))
-      (inst add esp-tn 4))
     (unless (zerop amount)
       (let ((delta (logandc2 (+ amount 3) 3)))
 	(inst sub esp-tn delta)))
-    #+darwin (inst and esp-tn #xfffffff0)
+    ;; Align the stack to a 16-byte boundary.
+    (inst and esp-tn #xfffffff0)
     (move result esp-tn)))
 
 (define-vop (dealloc-number-stack-space)
@@ -91,15 +83,5 @@
   (:generator 0
     (unless (zerop amount)
       (let ((delta (logandc2 (+ amount 3) 3)))
-	(inst add esp-tn delta)))
-    #+(or linux)
-    (progn
-      ;; Is this needed with sse2?
-      (inst sub esp-tn 4)
-      (inst fnstcw (make-ea :word :base esp-tn))
-      (inst and (make-ea :word :base esp-tn) #xcff)
-      (inst or (make-ea :word :base esp-tn) #x200)
-      (inst fldcw (make-ea :word :base esp-tn))
-      (inst wait)
-      (inst add esp-tn 4))))
+	(inst add esp-tn delta)))))
 

-----------------------------------------------------------------------

Summary of changes:
 src/compiler/x86/sse2-c-call.lisp |   24 +++---------------------
 src/lisp/x86-assem.S              |   32 --------------------------------
 2 files changed, 3 insertions(+), 53 deletions(-)


hooks/post-receive
-- 
CMU Common Lisp


More information about the cmucl-commit mailing list