0.9.2.37:
[sbcl.git] / src / assembly / x86-64 / arith.lisp
index 71f05b0..a6f4d5e 100644 (file)
     OKAY)
 
   (define-generic-arith-routine (- 10)
-    ;; FIXME: This is screwed up.
-      ;;; I can't figure out the flags on subtract. Overflow never gets
-      ;;; set and carry always does. (- 0 most-negative-fixnum) can't be
-      ;;; easily detected so just let the upper level stuff do it.
-    (inst jmp DO-STATIC-FUN)
-
     (move res x)
     (inst sub res y)
     (inst jmp :no OKAY)
+    (inst cmc)                        ; carry has correct sign now
     (inst rcr res 1)
     (inst sar res 2)                 ; remove type bits
 
@@ -93,7 +88,7 @@
     (move rax x)                  ; must use eax for 64-bit result
     (inst sar rax 3)              ; remove *4 fixnum bias
     (inst imul y)                 ; result in edx:eax
-    (inst jmp :no okay)                   ; still fixnum
+    (inst jmp :no OKAY)                   ; still fixnum
 
     ;; zzz jrd changed edx to ebx in here, as edx isn't listed as a temp, above
     ;;     pfw says that loses big -- edx is target for arg x and result res