((unsigned-byte-32 unsigned-byte-31)
unsigned-reg move-if/unsigned)
(signed-byte-32 signed-reg move-if/signed)
+ ;; FIXME: Can't use CMOV with byte registers, and characters live
+ ;; in such outside of unicode builds. A better solution then just
+ ;; disabling MOVE-IF/CHAR should be possible, though.
+ #!+sb-unicode
(character character-reg move-if/char)
((single-float complex-single-float
the values, and VOP-name the name of the VOP that will be used
to execute the conditional move.")
-(!def-vm-support-routine
- convert-conditional-move-p (node dst-tn x-tn y-tn)
+(defun convert-conditional-move-p (node dst-tn x-tn y-tn)
(declare (ignore node))
(let* ((ptype (sb!c::tn-primitive-type dst-tn))
(name (sb!c::primitive-type-name ptype))
(let ((scn (sc-number-or-lose representation)))
(labels ((make-tn ()
(make-representation-tn ptype scn))
- (immediate-tn-p (tn)
- (and (eq (sb!c::tn-kind tn) :constant)
- (eq (sb!c::immediate-constant-sc (tn-value tn))
- (sc-number-or-lose 'immediate))))
(frob-tn (tn)
(if (immediate-tn-p tn)
tn
(setf then temp))
(inst cmov (first flags) res then))))
-(macrolet ((def-move-if (name type reg &optional stack)
- (when stack (setf stack (list stack)))
-
+(macrolet ((def-move-if (name type reg stack)
`(define-vop (,name move-if)
- (:args (then :scs (immediate ,reg ,@stack) :to :eval
+ (:args (then :scs (immediate ,reg ,stack) :to :eval
:target temp
:load-if (not (or (sc-is then immediate)
- (and (sc-is then ,@stack)
+ (and (sc-is then ,stack)
(not (location= else res))))))
- (else :scs (immediate ,reg ,@stack) :target res
- :load-if (not (sc-is else immediate ,@stack))))
+ (else :scs (immediate ,reg ,stack) :target res
+ :load-if (not (sc-is else immediate ,stack))))
(:arg-types ,type ,type)
(:results (res :scs (,reg)
:from (:argument 1)))
(:result-types ,type))))
- (def-move-if move-if/t
- t descriptor-reg control-stack)
- (def-move-if move-if/fx
- tagged-num any-reg control-stack)
- (def-move-if move-if/unsigned
- unsigned-num unsigned-reg unsigned-stack)
- (def-move-if move-if/signed
- signed-num signed-reg signed-stack)
- (def-move-if move-if/char
- character character-reg character-stack)
- (def-move-if move-if/sap
- system-area-pointer sap-reg sap-stack))
+ (def-move-if move-if/t t descriptor-reg control-stack)
+ (def-move-if move-if/fx tagged-num any-reg control-stack)
+ (def-move-if move-if/unsigned unsigned-num unsigned-reg unsigned-stack)
+ (def-move-if move-if/signed signed-num signed-reg signed-stack)
+ ;; FIXME: See *CMOV-PTYPE-REPRESENTATION-VOP* above.
+ #!+sb-unicode
+ (def-move-if move-if/char character character-reg character-stack)
+ (def-move-if move-if/sap system-area-pointer sap-reg sap-stack))
\f
;;;; conditional VOPs
(:info)
(:policy :fast-safe)
(:translate eq)
- (:generator 3
+ (:generator 6
(let ((x-val (encode-value-if-immediate x))
(y-val (encode-value-if-immediate y)))
(cond
((sc-is x immediate) (inst cmp y x-val))
(t (inst cmp x y-val))))))
+
+(macrolet ((def (eq-name eql-name cost)
+ `(define-vop (,eq-name ,eql-name)
+ (:translate eq)
+ (:variant-cost ,cost))))
+ (def fast-if-eq-character fast-char=/character 3)
+ (def fast-if-eq-character/c fast-char=/character/c 2)
+ (def fast-if-eq-fixnum fast-eql/fixnum 3)
+ (def fast-if-eq-fixnum/c fast-eql-c/fixnum 2)
+ (def fast-if-eq-signed fast-if-eql/signed 5)
+ (def fast-if-eq-signed/c fast-if-eql-c/signed 4)
+ (def fast-if-eq-unsigned fast-if-eql/unsigned 5)
+ (def fast-if-eq-unsigned/c fast-if-eql-c/unsigned 4))