Ignore:
Timestamp:
Jan 1, 2008, 1:49:03 AM (12 years ago)
Author:
gb
Message:

Try to use COMPARE-TO-T, COMPARE-CONSTANT-TO-REGISTER for EQ/NEQ.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2-devel/ccl/compiler/X86/x862.lisp

    r7938 r7981  
    33853385      (^))))
    33863386
     3387(defun x862-compare-register-to-constant (seg vreg xfer ireg cr-bit true-p constant)
     3388  (cond ((eq constant *nx-nil*)
     3389         (x862-compare-register-to-nil seg vreg xfer ireg cr-bit true-p))
     3390        (t
     3391         (with-x86-local-vinsn-macros (seg vreg xfer)
     3392           (when vreg
     3393             (if (eq constant *nx-t*)
     3394               (! compare-to-t ireg)
     3395               (let* ((imm (x862-immediate-operand constant))
     3396                      (reg (x862-register-constant-p imm)))
     3397                 (if reg
     3398                   (! compare-registers reg ireg)
     3399                   (! compare-constant-to-register (x86-immediate-label imm) ireg))))
     3400             (regspec-crf-gpr-case
     3401              (vreg dest)
     3402              (^ cr-bit true-p)
     3403              (progn
     3404                (ensuring-node-target (target dest)
     3405                  (if (not true-p)
     3406                    (setq cr-bit (logxor 1 cr-bit)))
     3407                  (! cr-bit->boolean target cr-bit))
     3408                (^))))))))
     3409         
    33873410(defun x862-compare-register-to-nil (seg vreg xfer ireg cr-bit true-p)
    33883411  (with-x86-local-vinsn-macros (seg vreg xfer)
     
    61486171    (^)))
    61496172
     6173(defun x862-eq-test (seg vreg xfer cc form1 form2)
     6174  (with-x86-local-vinsn-macros (seg)
     6175    (multiple-value-bind (cr-bit true-p) (acode-condition-to-x86-cr-bit cc)
     6176      (let* ((f1 (acode-unwrapped-form form1))
     6177             (f2 (acode-unwrapped-form form2)))
     6178        (cond ((or (eq f1 *nx-nil*)
     6179                   (eq f1 *nx-t*)
     6180                   (and (acode-p f1)
     6181                        (eq (acode-operator f1) (%nx1-operator immediate))))
     6182               (x862-compare-register-to-constant seg vreg xfer (x862-one-untargeted-reg-form seg form2 ($ x8664::arg_z)) cr-bit true-p f1))
     6183              ((or (eq f2 *nx-nil*)
     6184                   (eq f2 *nx-t*)
     6185                   (and (acode-p f2)
     6186                        (eq (acode-operator f2) (%nx1-operator immediate))))
     6187               (x862-compare-register-to-constant seg vreg xfer
     6188                                                  (x862-one-untargeted-reg-form seg form1 ($ x8664::arg_z))
     6189                                                  cr-bit true-p f2))
     6190              (t (x862-compare seg vreg xfer form1 form2 cr-bit true-p)))))))
     6191
    61506192(defx862 x862-eq eq (seg vreg xfer cc form1 form2)
    6151   (multiple-value-bind (cr-bit true-p) (acode-condition-to-x86-cr-bit cc)
    6152     (x862-compare seg vreg xfer form1 form2 cr-bit true-p)))
     6193  (x862-eq-test seg vreg xfer cc form1 form2))
    61536194
    61546195(defx862 x862-neq neq (seg vreg xfer cc form1 form2)
    6155   (multiple-value-bind (cr-bit true-p) (acode-condition-to-x86-cr-bit cc)
    6156     (x862-compare seg vreg xfer form1 form2 cr-bit true-p)))
     6196  (x862-eq-test seg vreg xfer cc form1 form2))
    61576197
    61586198(defx862 x862-numcmp numcmp (seg vreg xfer cc form1 form2)
Note: See TracChangeset for help on using the changeset viewer.