mirror of
git://git.code.sf.net/p/sbcl/sbcl
synced 2026-09-10 07:26:40 -04:00
x86-64, load-fp-immediate: dispatch on the value, not destination
Fixes lp#2158587
This commit is contained in:
parent
d8a8a93405
commit
b6b1188ebf
|
|
@ -78,16 +78,17 @@
|
|||
(fp-immediate) (double-reg)
|
||||
(fp-immediate) (complex-single-reg)
|
||||
(fp-immediate) (complex-double-reg))
|
||||
(if (member (tn-value x) '(0f0 0d0 #c(0d0 0d0) #c(0f0 0f0)))
|
||||
(sc-case y
|
||||
((single-reg complex-single-reg) (inst xorps y y))
|
||||
((double-reg complex-double-reg) (inst xorpd y y)))
|
||||
(let ((x (register-inline-constant (tn-value x))))
|
||||
(let ((x (tn-value x)))
|
||||
(if (member x '(0f0 0d0 #c(0d0 0d0) #c(0f0 0f0)))
|
||||
(sc-case y
|
||||
(single-reg (inst movss y x))
|
||||
(double-reg (inst movsd y x))
|
||||
(complex-single-reg (inst movq y x))
|
||||
(complex-double-reg (inst movapd y x))))))
|
||||
((single-reg complex-single-reg) (inst xorps y y))
|
||||
((double-reg complex-double-reg) (inst xorpd y y)))
|
||||
(let ((c (register-inline-constant x)))
|
||||
(etypecase x
|
||||
(single-float (inst movss y c))
|
||||
(double-float (inst movsd y c))
|
||||
(complex-single-float (inst movq y c))
|
||||
(complex-double-float (inst movupd y c)))))))
|
||||
|
||||
(define-move-fun (load-single 2) (vop x y)
|
||||
((single-stack) (single-reg))
|
||||
|
|
|
|||
|
|
@ -925,4 +925,9 @@ fractional bits."
|
|||
()
|
||||
`(lambda (d)
|
||||
(- #c(1d0 3d0) (the double-float d)))
|
||||
((4d0) #C(-3d0 3d0))))
|
||||
((4d0) #C(-3d0 3d0)))
|
||||
(checked-compile-and-assert
|
||||
()
|
||||
`(lambda (c)
|
||||
(- 5 (the (complex double-float) c)))
|
||||
((#c(1d0 3)) #C(4d0 -3))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue