Microoptimize type-tests on x86oids.
[sbcl.git] / src / compiler / x86 / type-vops.lisp
index aca94f3..a1c6655 100644 (file)
@@ -65,6 +65,8 @@
         (if not-p
             (values :ne :a :b drop-through target)
             (values :e :na :nb target drop-through))
+      ;; %test-lowtag loads an untagged pointer into EAX, which allows
+      ;; to avoid untagging below
       (%test-lowtag value when-false t lowtag)
       (cond
         ((and (null (cdr headers))
          ;; [BIGNUM-WIDETAG..FOO-WIDETAG]) is also possible, but such
          ;; opportunities don't come up very often and the code would
          ;; get pretty hairy...
-         (inst cmp (make-ea :byte :base value :disp (- lowtag)) (car headers))
+         (inst cmp (make-ea :byte :base eax-tn) (car headers))
          (inst jmp equal target))
         (t
-         (inst mov al-tn (make-ea :byte :base value :disp (- lowtag)))
+         (inst mov al-tn (make-ea :byte :base eax-tn))
          (do ((remaining headers (cdr remaining)))
              ((null remaining))
            (let ((header (car remaining))