X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Ffloat.lisp;h=601dabd8cafe1858b277b54d1c98962a47fbb6c0;hb=33a45339444f8418c8c537c43d59fc3d5ea3098b;hp=227e1f96b2f70ef8ce12cb0b4313e7e8c7da2557;hpb=a93f828030465bfc0fb85957693f1c3c2ab0a539;p=sbcl.git diff --git a/src/compiler/x86-64/float.lisp b/src/compiler/x86-64/float.lisp index 227e1f9..601dabd 100644 --- a/src/compiler/x86-64/float.lisp +++ b/src/compiler/x86-64/float.lisp @@ -51,9 +51,7 @@ (+ (tn-offset ,tn) (cond ((= (tn-offset ,base) rsp-offset) sp->fp-offset) - ((= (tn-offset ,base) rbp-offset) - 0) - (t (error "Unexpected offset."))) + (t 0)) (ecase ,kind (:single (ecase ,slot @@ -794,6 +792,8 @@ (:vop-var vop) (:save-p :compute-only) (:generator 1 + (unless (location= x y) + (inst xorpd y y)) (note-this-location vop :internal-error) (inst sqrtsd y x))) @@ -1071,6 +1071,9 @@ (:vop-var vop) (:save-p :compute-only) (:generator 5 + (sc-case y + (single-reg (inst xorps y y)) + (double-reg (inst xorpd y y))) (note-this-location vop :internal-error) (inst ,inst y x))))) (frob %single-float/signed %single-float cvtsi2ss single-reg single-float) @@ -1088,10 +1091,18 @@ (:vop-var vop) (:save-p :compute-only) (:generator 2 + (unless (location= x y) + (sc-case y + (single-reg (inst xorps y y)) + (double-reg (inst xorpd y y)))) (note-this-location vop :internal-error) (inst ,inst y (sc-case x (,(first from-scs) x) - (,(second from-scs) (,ea-func x)))))))) + (,(second from-scs) (,ea-func x)))) + ,(when (and (eq from-type 'double-float) ; if the input is wider + (eq to-type 'single-float)) ; than the output, clear + `(when (location= x y) ; noise in the high part + (inst shufps y y #4r3330))))))) (frob %single-float/double-float %single-float cvtsd2ss (double-reg double-stack) double-float ea-for-df-stack single-reg single-float)