X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Ffloat.lisp;h=c885e1305cd6006428286b543d13e9235f61f547;hb=f3f677703e37f5a335b3be7fa64f7748ad969517;hp=8c00995ebc4117c152fa4119c2bb52ae540d44a0;hpb=eaa8a506790bb6ed627da617247bfd13802eb365;p=sbcl.git diff --git a/src/compiler/x86-64/float.lisp b/src/compiler/x86-64/float.lisp index 8c00995..c885e13 100644 --- a/src/compiler/x86-64/float.lisp +++ b/src/compiler/x86-64/float.lisp @@ -329,10 +329,9 @@ (:single 1) (:double 2) )) n-word-bytes))))) - (with-tn@fp-top(x) - ,@(ecase format - (:single '((inst movss ea x))) - (:double '((inst movsd ea x))))))))))) + ,@(ecase format + (:single '((inst movss ea x))) + (:double '((inst movsd ea x)))))))))) (define-move-vop ,name :move-arg (,sc descriptor-reg) (,sc))))) (frob move-single-float-arg single-reg single-stack :single) @@ -766,61 +765,6 @@ (inst shr lo-bits 32))) -;;;; float mode hackery - -(sb!xc:deftype float-modes () '(unsigned-byte 64)) ; really only 16 -(defknown floating-point-modes () float-modes (flushable)) -(defknown ((setf floating-point-modes)) (float-modes) - float-modes) - -(define-vop (floating-point-modes) - (:results (res :scs (unsigned-reg))) - (:result-types unsigned-num) - (:translate floating-point-modes) - (:policy :fast-safe) - (:temporary (:sc unsigned-stack :from :argument :to :result) temp) - (:generator 8 - (inst stmxcsr temp) - (move res temp) - ;; Extract status from bytes 0-5 to bytes 16-21 - (inst and temp (1- (expt 2 6))) - (inst shl temp 16) - ;; Extract mask from bytes 7-12 to bytes 0-5 - (inst shr res 7) - (inst and res (1- (expt 2 6))) - ;; Flip the bits to convert from "1 means exception masked" to - ;; "1 means exception enabled". - (inst xor res (1- (expt 2 6))) - (inst or res temp))) - -(define-vop (set-floating-point-modes) - (:args (new :scs (unsigned-reg) :to :result :target res)) - (:results (res :scs (unsigned-reg))) - (:arg-types unsigned-num) - (:result-types unsigned-num) - (:translate (setf floating-point-modes)) - (:policy :fast-safe) - (:temporary (:sc unsigned-reg :from :argument :to :result) temp1) - (:temporary (:sc unsigned-stack :from :argument :to :result) temp2) - (:generator 3 - (move res new) - (inst stmxcsr temp2) - ;; Clear status + masks - (inst and temp2 (lognot (logior (1- (expt 2 6)) - (ash (1- (expt 2 6)) 7)))) - ;; Replace current status - (move temp1 new) - (inst shr temp1 16) - (inst and temp1 (1- (expt 2 6))) - (inst or temp2 temp1) - ;; Replace exception masks - (move temp1 new) - (inst and temp1 (1- (expt 2 6))) - (inst xor temp1 (1- (expt 2 6))) - (inst shl temp1 7) - (inst or temp2 temp1) - (inst ldmxcsr temp2))) - ;;;; complex float VOPs