1 ;;;; predicate VOPs for the x86 VM
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
19 ;;; The unconditional branch, emitted when we can't drop through to the desired
20 ;;; destination. Dest is the continuation we transfer control to.
29 ;;; Note: a constant-tn is allowed in CMP; it uses an EA displacement,
30 ;;; not immediate data.
32 (:args (x :scs (any-reg descriptor-reg control-stack constant)
33 :load-if (not (and (sc-is x immediate)
34 (sc-is y any-reg descriptor-reg
35 control-stack constant))))
36 (y :scs (any-reg descriptor-reg immediate)
37 :load-if (not (and (sc-is x any-reg descriptor-reg immediate)
38 (sc-is y control-stack constant)))))
46 (let ((val (tn-value y)))
49 (if (and (zerop val) (sc-is x any-reg descriptor-reg))
50 (inst test x x) ; smaller
51 (inst cmp x (fixnumize val))))
53 (inst cmp x (+ nil-value (static-symbol-offset val))))
55 (inst cmp x (logior (ash (char-code val) type-bits)
57 ((sc-is x immediate) ; and y not immediate
58 ;; Swap the order to fit the compare instruction.
59 (let ((val (tn-value x)))
62 (if (and (zerop val) (sc-is y any-reg descriptor-reg))
63 (inst test y y) ; smaller
64 (inst cmp y (fixnumize val))))
66 (inst cmp y (+ nil-value (static-symbol-offset val))))
68 (inst cmp y (logior (ash (char-code val) type-bits)
73 (inst jmp (if not-p :ne :e) target)))