X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Farith.lisp;h=f455bff84d19ce993595c7af6e5581de0abdc75d;hb=69e6aef5e6fb3bd682c7a2cbf774034d2ea58ee8;hp=c50e0ddb13ae9d04571fd891fff1afb8dfca804a;hpb=dacd3fc70cf2fc78677f9a8bbbb5c3b51883f1b7;p=sbcl.git diff --git a/src/compiler/x86-64/arith.lisp b/src/compiler/x86-64/arith.lisp index c50e0dd..f455bff 100644 --- a/src/compiler/x86-64/arith.lisp +++ b/src/compiler/x86-64/arith.lisp @@ -1328,13 +1328,17 @@ constant shift greater than word length"))) (:translate ,tran) (:conditional ,(if signed cond unsigned)) (:generator ,cost - (inst cmp x - ,(case suffix - (-c/fixnum - `(constantize (fixnumize y))) - ((-c/signed -c/unsigned) - `(constantize y)) - (t 'y)))))) + (cond ((and (sc-is x any-reg signed-reg unsigned-reg) + (eql y 0)) + (inst test x x)) + (t + (inst cmp x + ,(case suffix + (-c/fixnum + `(constantize (fixnumize y))) + ((-c/signed -c/unsigned) + `(constantize y)) + (t 'y)))))))) '(/fixnum -c/fixnum /signed -c/signed /unsigned -c/unsigned) ; '(/fixnum /signed /unsigned) '(4 3 6 5 6 5)