From 1626be46a98e3b18e7609227ffd7823155dcffc4 Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Thu, 21 Aug 2014 23:16:02 -0700
Subject: [PATCH] On x86/darwin, we want and only need the sse2 mode bits.
 Darwin doesn't use x87.

---
 src/code/float-trap.lisp | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/code/float-trap.lisp b/src/code/float-trap.lisp
index d97d04e82..db0a9c41b 100644
--- a/src/code/float-trap.lisp
+++ b/src/code/float-trap.lisp
@@ -87,7 +87,7 @@
     (setf (x87-floating-point-modes) x87-modes)))
   )
 
-#+sse2
+#+(and sse2 (not darwin))
 (progn
   (defun floating-point-modes ()
     ;; Combine the modes from the FPU and SSE2 units.  Since the sse
@@ -119,7 +119,20 @@
       (setf (vm::sse2-floating-point-modes) new-mode)
       (setf (vm::x87-floating-point-modes) x87-modes))
     new-mode)
-)
+  )
+
+#(and sse2 darwin)
+(progn
+  (defun floating-point-modes ()
+    ;; Get just the SSE2 mode bits.
+    (vm::sse2-floating-point-modes))
+
+  (defun (setf floating-point-modes) (new-mode)
+    (declare (type (unsigned-byte 24) new-mode))
+    ;; Set the floating point modes for SSE2.
+    (setf (vm::sse2-floating-point-modes) new-mode)
+    new-mode)
+  )
 
 ;;; SET-FLOATING-POINT-MODES  --  Public
 ;;;
-- 
GitLab