- (error "can't mix fixnum testing with function subtype testing"))
- (when immediates
- (error "can't mix fixnum testing with other immediates"))
- (if headers
- `(%test-fixnum-and-headers ,value ,target ,not-p
- ',(canonicalize-headers headers)
- ,@other-args)
- `(%test-fixnum ,value ,target ,not-p
- ,@other-args)))
+ (error "can't mix fixnum testing with function subtype testing"))
+ (cond
+ ((and (= sb!vm:n-word-bits 64) immediates headers)
+ `(%test-fixnum-immediate-and-headers ,value ,target ,not-p
+ ,(car immediates)
+ ',(canonicalize-headers
+ headers)
+ ,@other-args))
+ (immediates
+ (if (= sb!vm:n-word-bits 64)
+ `(%test-fixnum-and-immediate ,value ,target ,not-p
+ ,(car immediates)
+ ,@other-args)
+ (error "can't mix fixnum testing with other immediates")))
+ (headers
+ `(%test-fixnum-and-headers ,value ,target ,not-p
+ ',(canonicalize-headers headers)
+ ,@other-args))
+ (t
+ `(%test-fixnum ,value ,target ,not-p
+ ,@other-args))))