X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Ffloat.lisp;h=0a03d50d1faeea26f646171064d85a4d9e6863ff;hb=8a33bf220856487a5cde4b183476b6ab5103983a;hp=ec3fad0e56d7638a3e3abcf7cd632c6b6d93e3ea;hpb=9e37bfc1ef0532a16a9ac8b1e48123ee19347f80;p=sbcl.git diff --git a/src/compiler/x86-64/float.lisp b/src/compiler/x86-64/float.lisp index ec3fad0..0a03d50 100644 --- a/src/compiler/x86-64/float.lisp +++ b/src/compiler/x86-64/float.lisp @@ -390,27 +390,31 @@ complex-double-float)) (macrolet ((generate (opinst commutative constant-sc load-inst) - `(flet ((get-constant (tn) - (register-inline-constant - ,@(and (eq constant-sc 'fp-single-immediate) - '(:aligned)) - (tn-value tn)))) + `(flet ((get-constant (tn &optional maybe-aligned) + (declare (ignorable maybe-aligned)) + (let ((value (tn-value tn))) + ,(if (eq constant-sc 'fp-complex-single-immediate) + `(if maybe-aligned + (register-inline-constant + :aligned value) + (register-inline-constant value)) + `(register-inline-constant value))))) (declare (ignorable #'get-constant)) (cond ((location= x r) (when (sc-is y ,constant-sc) - (setf y (get-constant y))) + (setf y (get-constant y t))) (inst ,opinst x y)) ((and ,commutative (location= y r)) (when (sc-is x ,constant-sc) - (setf x (get-constant x))) + (setf x (get-constant x t))) (inst ,opinst y x)) ((not (location= r y)) (if (sc-is x ,constant-sc) (inst ,load-inst r (get-constant x)) (move r x)) (when (sc-is y ,constant-sc) - (setf y (get-constant y))) + (setf y (get-constant y t))) (inst ,opinst r y)) (t (if (sc-is x ,constant-sc) @@ -809,12 +813,9 @@ (:vop-var vop) (:save-p :compute-only) (:generator 1 - (note-this-location vop :internal-error) - ;; we should be able to do this better. what we - ;; really would like to do is use the target as the - ;; temp whenever it's not also the source - (move y x) - ,@body)))) + (note-this-location vop :internal-error) + (move y x) + ,@body)))) (frob (%negate/double-float %negate double-reg double-float) (inst xorpd y (register-inline-constant :oword (ash 1 63)))) (frob (%negate/complex-double-float %negate complex-double-reg complex-double-float) @@ -855,7 +856,7 @@ :load-if (not (sc-is y ,constant-sc)))) (:arg-types ,type ,type) (:temporary (:sc ,sc :from :eval) mask) - (:temporary (:sc any-reg) bits) + (:temporary (:sc dword-reg) bits) (:conditional :e) (:generator ,cost (when (or (location= y mask) @@ -867,7 +868,8 @@ (setf y (register-inline-constant :aligned (tn-value y)))) (inst pcmpeqd mask y) (inst movmskps bits mask) - (inst cmp bits #b1111))))) + (inst cmp (if (location= bits eax-tn) al-tn bits) + #b1111))))) (define-float-eql eql/single-float 4 single-reg fp-single-immediate single-float) (define-float-eql eql/double-float 4 @@ -979,7 +981,7 @@ :load-if (not (sc-is y ,complex-constant-sc)))) (:arg-types ,complex-type ,complex-type) (:temporary (:sc ,complex-sc :from :eval) cmp) - (:temporary (:sc unsigned-reg) bits) + (:temporary (:sc dword-reg) bits) (:info) (:conditional :e) (:generator 3 @@ -999,7 +1001,8 @@ (note-this-location vop :internal-error) (inst ,cmp-inst :eq cmp y) (inst ,mask-inst bits cmp) - (inst cmp bits ,mask))) + (inst cmp (if (location= bits eax-tn) al-tn bits) + ,mask))) (define-vop (,complex-real-name ,complex-complex-name) (:args (x :scs (,complex-sc ,complex-constant-sc) :target cmp