From 75d14d2ed7dc9085858d9119013b67fbdfe77390 Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Mon, 4 Aug 2014 18:55:27 -0700
Subject: [PATCH] Fix bug in DOUBLE-FLOAT-BITS vop.

Add a lifetime spec to the arg so that we don't accidentally destroy
the arg when writing the two results.  Previously, HI-BITS was
allocated to the same register as FLOAT (in a descriptor). Writing
HI-BITS would destroy the contents of the FLOAT and when trying to
write lo-bits, we would read from the wrong address because FLOAT now
contains the high bits of the double float number.
---
 src/compiler/x86/float-sse2.lisp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/x86/float-sse2.lisp b/src/compiler/x86/float-sse2.lisp
index bfa6df901..e7b1b8665 100644
--- a/src/compiler/x86/float-sse2.lisp
+++ b/src/compiler/x86/float-sse2.lisp
@@ -1272,7 +1272,8 @@
 
 (define-vop (double-float-bits)
   (:args (float :scs (double-reg descriptor-reg)
-		:load-if (not (sc-is float double-stack))))
+		:load-if (not (sc-is float double-stack))
+		:to (:result 1)))
   (:results (hi-bits :scs (signed-reg))
 	    (lo-bits :scs (unsigned-reg)))
   (:arg-types double-float)
-- 
GitLab