+ ;; We could encode this with :Z and SHR, analogously to the signed-byte-32
+ ;; case below -- as we do on x86-64 -- but that costs us an extra
+ ;; register. Compromises...
+ (inst cmp value #.sb!xc:most-positive-fixnum)))
+
+(define-vop (fixnump/signed-byte-32 type-predicate)
+ (:args (value :scs (signed-reg)))
+ (:info)
+ (:conditional :z)
+ (:arg-types signed-num)
+ (:translate fixnump)
+ (:generator 5
+ ;; Hackers Delight, p. 53: signed
+ ;; a <= x <= a + 2^n - 1
+ ;; is equivalent to unsigned
+ ;; ((x-a) >> n) = 0
+ (inst mov eax-tn value)
+ (inst sub eax-tn #.sb!xc:most-negative-fixnum)
+ (inst shr eax-tn #.(integer-length (- sb!xc:most-positive-fixnum
+ sb!xc:most-negative-fixnum)))))