Commit 187d987e authored by Raymond Toy's avatar Raymond Toy
Browse files

Use SSE2 instructions for MAKE-DOUBLE-FLOAT

Instead of storing the high and low words to memory and then loading
it into the double-reg, use SSE2 instructions to directly create the
double-float from the high and low words.
parent 23209c84
Loading
Loading
Loading
Loading
+10 −9
Changes for src/compiler/x86/float-sse2.lisp: 10 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -1178,21 +1178,22 @@
           (inst movd res bits)))))))

(define-vop (make-double-float)
  (:args (hi-bits :scs (signed-reg))
	 (lo-bits :scs (unsigned-reg)))
  (:args (hi-bits :scs (signed-reg)
		  :load-if (not (sc-is hi-bits signed-stack)))
	 (lo-bits :scs (unsigned-reg)
		  :load-if (not (sc-is lo-bits signed-stack))))
  (:results (res :scs (double-reg)))
  (:temporary (:sc double-stack) temp)
  (:arg-types signed-num unsigned-num)
  (:result-types double-float)
  (:translate make-double-float)
  (:temporary (:sc double-reg) temp)
  (:policy :fast-safe)
  (:vop-var vop)
  (:generator 2
    (let ((offset (1+ (tn-offset temp))))
      (storew hi-bits ebp-tn (- offset))
      (storew lo-bits ebp-tn (- (1+ offset)))
      (inst movsd res (make-ea :dword :base ebp-tn
			    :disp (- (* (1+ offset) word-bytes)))))))
  (:generator 4
    (inst movd temp hi-bits)
    (inst psllq temp 32)
    (inst movd res lo-bits)
    (inst orpd res temp)))


(define-vop (single-float-bits)