X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fassembly%2Fx86-64%2Farith.lisp;h=a6f4d5e0389acf6c3573750524faa11bf7630f48;hb=bb756e3d4b19c30d4a9cd4250b606c5969613ad9;hp=71f05b0851cfe8484788880ba0deffd2084b036b;hpb=78fa16bf55be44cc16845be84d98023e83fb14bc;p=sbcl.git diff --git a/src/assembly/x86-64/arith.lisp b/src/assembly/x86-64/arith.lisp index 71f05b0..a6f4d5e 100644 --- a/src/assembly/x86-64/arith.lisp +++ b/src/assembly/x86-64/arith.lisp @@ -71,15 +71,10 @@ 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