From: stassats <sta...@us...> - 2013-05-02 11:32:57
|
The branch "master" has been updated in SBCL: via 46ba0c8008b39dc085fd5b630914de70696675da (commit) from a5fbc248b7513f19a31e58a591a27868f30354ef (commit) - Log ----------------------------------------------------------------- commit 46ba0c8008b39dc085fd5b630914de70696675da Author: Stas Boukarev <sta...@gm...> Date: Wed May 1 14:15:45 2013 +0400 Correct integer-length on fixnums on x86-64 when n-fixnum-tag-bits > 1. Use SAR, not SHR for untagging, to preserve the sign. Thanks to Paul Khuong. --- src/compiler/x86-64/arith.lisp | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/compiler/x86-64/arith.lisp b/src/compiler/x86-64/arith.lisp index 22d5bc1..1413f40 100644 --- a/src/compiler/x86-64/arith.lisp +++ b/src/compiler/x86-64/arith.lisp @@ -1012,9 +1012,7 @@ constant shift greater than word length"))) (:result-types unsigned-num) (:generator 28 (move res arg) - (if (sc-is res unsigned-reg) - (inst test res res) - (inst cmp res 0)) + (inst test res res) (inst jmp :ge POS) (inst not res) POS @@ -1081,10 +1079,8 @@ constant shift greater than word length"))) (:generator 25 (move res arg) (when (> n-fixnum-tag-bits 1) - (inst shr res (1- n-fixnum-tag-bits))) - (if (sc-is res unsigned-reg) - (inst test res res) - (inst cmp res 0)) + (inst sar res (1- n-fixnum-tag-bits))) + (inst test res res) (inst jmp :ge POS) (inst not res) POS ----------------------------------------------------------------------- hooks/post-receive -- SBCL |