1.0.24.35: Flag-setting VOPs on x86[-64] and conditional moves
[sbcl.git] / src / compiler / x86 / float.lisp
index cd2c3ba..9e10b3c 100644 (file)
 (in-package "SB!VM")
 \f
 (macrolet ((ea-for-xf-desc (tn slot)
-             `(make-ea
-               :dword :base ,tn
-               :disp (- (* ,slot n-word-bytes)
-                        other-pointer-lowtag))))
+             `(make-ea-for-object-slot ,tn ,slot other-pointer-lowtag)))
   (defun ea-for-sf-desc (tn)
     (ea-for-xf-desc tn single-float-value-slot))
   (defun ea-for-df-desc (tn)
 (define-vop (=/float)
   (:args (x) (y))
   (:temporary (:sc word-reg :offset eax-offset :from :eval) temp)
-  (:conditional)
-  (:info target not-p)
+  (:conditional :e)
   (:policy :fast-safe)
   (:vop-var vop)
   (:save-p :compute-only)
        (inst fxch x)))
      (inst fnstsw)                      ; status word to ax
      (inst and ah-tn #x45)              ; C3 C2 C0
-     (inst cmp ah-tn #x40)
-     (inst jmp (if not-p :ne :e) target)))
+     (inst cmp ah-tn #x40)))
 
 (define-vop (=/single-float =/float)
   (:translate =)
   (:arg-types single-float single-float)
   (:temporary (:sc single-reg :offset fr0-offset :from :eval) fr0)
   (:temporary (:sc word-reg :offset eax-offset :from :eval) temp)
-  (:conditional)
-  (:info target not-p)
+  (:conditional :e)
   (:policy :fast-safe)
   (:note "inline float comparison")
   (:ignore temp)
            (inst fcom (ea-for-sf-desc y)))))
       (inst fnstsw)                     ; status word to ax
       (inst and ah-tn #x45)             ; C3 C2 C0
-      (inst cmp ah-tn #x01)))
-    (inst jmp (if not-p :ne :e) target)))
+      (inst cmp ah-tn #x01)))))
 
 (define-vop (<double-float)
   (:translate <)
   (:arg-types double-float double-float)
   (:temporary (:sc double-reg :offset fr0-offset :from :eval) fr0)
   (:temporary (:sc word-reg :offset eax-offset :from :eval) temp)
-  (:conditional)
-  (:info target not-p)
+  (:conditional :e)
   (:policy :fast-safe)
   (:note "inline float comparison")
   (:ignore temp)
            (inst fcomd (ea-for-df-desc y)))))
       (inst fnstsw)                     ; status word to ax
       (inst and ah-tn #x45)             ; C3 C2 C0
-      (inst cmp ah-tn #x01)))
-    (inst jmp (if not-p :ne :e) target)))
+      (inst cmp ah-tn #x01)))))
 
 #!+long-float
 (define-vop (<long-float)
          (y :scs (long-reg)))
   (:arg-types long-float long-float)
   (:temporary (:sc word-reg :offset eax-offset :from :eval) temp)
-  (:conditional)
-  (:info target not-p)
+  (:conditional :e)
   (:policy :fast-safe)
   (:note "inline float comparison")
   (:ignore temp)
        (inst fcomd x)
        (inst fxch y)
        (inst fnstsw)                    ; status word to ax
-       (inst and ah-tn #x45)))          ; C3 C2 C0
-    (inst jmp (if not-p :ne :e) target)))
+       (inst and ah-tn #x45)))))        ; C3 C2 C0
+
 
 (define-vop (>single-float)
   (:translate >)
   (:arg-types single-float single-float)
   (:temporary (:sc single-reg :offset fr0-offset :from :eval) fr0)
   (:temporary (:sc word-reg :offset eax-offset :from :eval) temp)
-  (:conditional)
-  (:info target not-p)
+  (:conditional :e)
   (:policy :fast-safe)
   (:note "inline float comparison")
   (:ignore temp)
              (inst fcom (ea-for-sf-stack y))
            (inst fcom (ea-for-sf-desc y)))))
       (inst fnstsw)                     ; status word to ax
-      (inst and ah-tn #x45)))
-    (inst jmp (if not-p :ne :e) target)))
+      (inst and ah-tn #x45)))))
 
 (define-vop (>double-float)
   (:translate >)
   (:arg-types double-float double-float)
   (:temporary (:sc double-reg :offset fr0-offset :from :eval) fr0)
   (:temporary (:sc word-reg :offset eax-offset :from :eval) temp)
-  (:conditional)
-  (:info target not-p)
+  (:conditional :e)
   (:policy :fast-safe)
   (:note "inline float comparison")
   (:ignore temp)
              (inst fcomd (ea-for-df-stack y))
            (inst fcomd (ea-for-df-desc y)))))
       (inst fnstsw)                     ; status word to ax
-      (inst and ah-tn #x45)))
-    (inst jmp (if not-p :ne :e) target)))
+      (inst and ah-tn #x45)))))
 
 #!+long-float
 (define-vop (>long-float)
          (y :scs (long-reg)))
   (:arg-types long-float long-float)
   (:temporary (:sc word-reg :offset eax-offset :from :eval) temp)
-  (:conditional)
-  (:info target not-p)
+  (:conditional :e)
   (:policy :fast-safe)
   (:note "inline float comparison")
   (:ignore temp)
        (inst fcomd y)
        (inst fxch x)
        (inst fnstsw)                    ; status word to ax
-       (inst and ah-tn #x45)))
-    (inst jmp (if not-p :ne :e) target)))
+       (inst and ah-tn #x45)))))
 
 ;;; Comparisons with 0 can use the FTST instruction.
 
 (define-vop (float-test)
   (:args (x))
   (:temporary (:sc word-reg :offset eax-offset :from :eval) temp)
-  (:conditional)
-  (:info target not-p y)
+  (:conditional :e)
+  (:info y)
   (:variant-vars code)
   (:policy :fast-safe)
   (:vop-var vop)
      (inst fnstsw)                      ; status word to ax
      (inst and ah-tn #x45)              ; C3 C2 C0
      (unless (zerop code)
-        (inst cmp ah-tn code))
-     (inst jmp (if not-p :ne :e) target)))
+        (inst cmp ah-tn code))))
 
 (define-vop (=0/single-float float-test)
   (:translate =)
                        :disp (frame-byte-offset (tn-offset temp)))))
        (descriptor-reg
         (inst movsx exp-bits
-              (make-ea :word :base float
-                       :disp (- (* (+ 2 long-float-value-slot)
-                                   n-word-bytes)
-                                other-pointer-lowtag)))))))
+              (make-ea-for-object-slot float (+ 2 long-float-value-slot)
+                                       other-pointer-lowtag :word))))))
 
 #!+long-float
 (define-vop (long-float-high-bits)