projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
check-mod-fixnum: correct the test for power-of-two.
[sbcl.git]
/
src
/
compiler
/
x86
/
type-vops.lisp
diff --git
a/src/compiler/x86/type-vops.lisp
b/src/compiler/x86/type-vops.lisp
index
4ad6d5d
..
a0223ff
100644
(file)
--- a/
src/compiler/x86/type-vops.lisp
+++ b/
src/compiler/x86/type-vops.lisp
@@
-376,12
+376,13
@@
(:temporary (:sc any-reg) temp)
(:generator 30
(let* ((low (numeric-type-low type))
(:temporary (:sc any-reg) temp)
(:generator 30
(let* ((low (numeric-type-low type))
- (hi (fixnumize (numeric-type-high type)))
+ (hi (numeric-type-high type))
+ (fixnum-hi (fixnumize hi))
(error (gen-label)))
;; FIXME: abstract
(assemble (*elsewhere*)
(emit-label error)
(error (gen-label)))
;; FIXME: abstract
(assemble (*elsewhere*)
(emit-label error)
- (inst mov temp hi)
+ (inst mov temp fixnum-hi)
(emit-error-break vop error-trap
(error-number-or-lose 'object-not-mod-error)
(list value temp)))
(emit-error-break vop error-trap
(error-number-or-lose 'object-not-mod-error)
(list value temp)))
@@
-390,12
+391,12
@@
;; Handle powers of two specially
;; The higher bits and the fixnum tag can be tested in one go
((= (logcount (1+ hi)) 1)
;; Handle powers of two specially
;; The higher bits and the fixnum tag can be tested in one go
((= (logcount (1+ hi)) 1)
- (inst test value (lognot hi))
+ (inst test value (lognot fixnum-hi))
(inst jmp :ne error))
(t
(generate-fixnum-test value)
(inst jmp :ne error)
(inst jmp :ne error))
(t
(generate-fixnum-test value)
(inst jmp :ne error)
- (inst cmp value hi)
+ (inst cmp value fixnum-hi)
(inst jmp :a error)))
(move result value))))
(inst jmp :a error)))
(move result value))))