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.
16 ;;; The unconditional branch, emitted when we can't drop through to the desired
17 ;;; destination. Dest is the continuation we transfer control to.
26 ;;; Note: a constant-tn is allowed in CMP; it uses an EA displacement,
27 ;;; not immediate data.
29 (:args (x :scs (any-reg descriptor-reg control-stack constant)
30 :load-if (not (and (sc-is x immediate)
31 (sc-is y any-reg descriptor-reg
32 control-stack constant))))
33 (y :scs (any-reg descriptor-reg immediate)
34 :load-if (not (and (sc-is x any-reg descriptor-reg immediate)
35 (sc-is y control-stack constant)))))
43 (let ((val (tn-value y)))
46 (if (and (zerop val) (sc-is x any-reg descriptor-reg))
47 (inst test x x) ; smaller
48 (inst cmp x (fixnumize val))))
50 (inst cmp x (+ nil-value (static-symbol-offset val))))
52 (inst cmp x (logior (ash (char-code val) n-widetag-bits)
53 character-widetag))))))
54 ((sc-is x immediate) ; and y not immediate
55 ;; Swap the order to fit the compare instruction.
56 (let ((val (tn-value x)))
59 (if (and (zerop val) (sc-is y any-reg descriptor-reg))
60 (inst test y y) ; smaller
61 (inst cmp y (fixnumize val))))
63 (inst cmp y (+ nil-value (static-symbol-offset val))))
65 (inst cmp y (logior (ash (char-code val) n-widetag-bits)
66 character-widetag))))))
70 (inst jmp (if not-p :ne :e) target)))