- `(define-assembly-routine (,name
- (:cost 10)
- (:return-style :full-call)
- (:policy :safe)
- (:translate ,translate)
- (:save-p t))
- ((:arg x (descriptor-reg any-reg) edx-offset)
- (:arg y (descriptor-reg any-reg) edi-offset)
-
- (:res res descriptor-reg edx-offset)
-
- (:temp eax unsigned-reg eax-offset)
- (:temp ecx unsigned-reg ecx-offset))
-
- ;; KLUDGE: The "3" here is a mask for the bits which will be
- ;; zero in a fixnum. It should have a symbolic name. (Actually,
- ;; it might already have a symbolic name which the coder
- ;; couldn't be bothered to use..) -- WHN 19990917
- (inst test x 3)
- (inst jmp :nz TAIL-CALL-TO-STATIC-FN)
- (inst test y 3)
- (inst jmp :z INLINE-FIXNUM-COMPARE)
-
- TAIL-CALL-TO-STATIC-FN
- (inst pop eax)
- (inst push ebp-tn)
- (inst lea ebp-tn (make-ea :dword
- :base esp-tn
- :disp n-word-bytes))
- (inst sub esp-tn (fixnumize 2)) ; FIXME: Push 2 words on stack,
- ; weirdly?
- (inst push eax)
- (inst mov ecx (fixnumize 2)) ; FIXME: FIXNUMIZE and
- ; SINGLE-FLOAT-BITS are parallel,
- ; should be named parallelly.
- (inst jmp (make-ea :dword
- :disp (+ nil-value
- (static-fun-offset ',static-fn))))
-
- INLINE-FIXNUM-COMPARE
- (inst cmp x y)
- (inst jmp ,test RETURN-TRUE)
- (inst mov res nil-value)
- ;; FIXME: A note explaining this return convention, or a
- ;; symbolic name for it, would be nice. (It looks as though we
- ;; should be hand-crafting the same return sequence as would be
- ;; produced by GENERATE-RETURN-SEQUENCE, but in that case it's
- ;; not clear why we don't just jump to the end of this function
- ;; to share the return sequence there.
- (inst pop eax)
- (inst add eax 2)
- (inst jmp eax)
-
- RETURN-TRUE
- (load-symbol res t))))
-
- (define-cond-assem-rtn generic-< < two-arg-< :l)
- (define-cond-assem-rtn generic-> > two-arg-> :g))
+ `(define-assembly-routine (,name
+ (:cost 10)
+ (:return-style :full-call)
+ (:policy :safe)
+ (:translate ,translate)
+ (:save-p t))
+ ((:arg x (descriptor-reg any-reg) edx-offset)
+ (:arg y (descriptor-reg any-reg) edi-offset)
+
+ (:res res descriptor-reg edx-offset)
+
+ (:temp eax unsigned-reg eax-offset)
+ (:temp ecx unsigned-reg ecx-offset))
+
+ ;; KLUDGE: The "3" here is a mask for the bits which will be
+ ;; zero in a fixnum. It should have a symbolic name. (Actually,
+ ;; it might already have a symbolic name which the coder
+ ;; couldn't be bothered to use..) -- WHN 19990917
+ (inst test x 3)
+ (inst jmp :nz TAIL-CALL-TO-STATIC-FN)
+ (inst test y 3)
+ (inst jmp :z INLINE-FIXNUM-COMPARE)
+
+ TAIL-CALL-TO-STATIC-FN
+ (inst pop eax)
+ (inst push ebp-tn)
+ (inst lea ebp-tn (make-ea :dword
+ :base esp-tn
+ :disp n-word-bytes))
+ (inst sub esp-tn (fixnumize 2)) ; FIXME: Push 2 words on stack,
+ ; weirdly?
+ (inst push eax)
+ (inst mov ecx (fixnumize 2)) ; FIXME: FIXNUMIZE and
+ ; SINGLE-FLOAT-BITS are parallel,
+ ; should be named parallelly.
+ (inst jmp (make-ea :dword
+ :disp (+ nil-value
+ (static-fun-offset ',static-fn))))
+
+ INLINE-FIXNUM-COMPARE
+ (inst cmp x y)
+ (inst mov res nil-value)
+ (inst jmp ,test RETURN-FALSE)
+
+ (load-symbol res t)
+
+ RETURN-FALSE
+ DONE)))
+
+ (define-cond-assem-rtn generic-< < two-arg-< :ge)
+ (define-cond-assem-rtn generic-> > two-arg-> :le))