projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
1.0.23.3: faster generic arithmetic dispatch on x86 and x86-64
[sbcl.git]
/
src
/
assembly
/
x86-64
/
arith.lisp
diff --git
a/src/assembly/x86-64/arith.lisp
b/src/assembly/x86-64/arith.lisp
index
4e8f81d
..
22fee87
100644
(file)
--- a/
src/assembly/x86-64/arith.lisp
+++ b/
src/assembly/x86-64/arith.lisp
@@
-28,15
+28,16
@@
(:res res (descriptor-reg any-reg) rdx-offset)
(:temp rax unsigned-reg rax-offset)
(:res res (descriptor-reg any-reg) rdx-offset)
(:temp rax unsigned-reg rax-offset)
- (:temp rbx unsigned-reg rbx-offset)
(:temp rcx unsigned-reg rcx-offset))
(:temp rcx unsigned-reg rcx-offset))
- (declare (ignorable rbx))
-
- (inst test x 7) ; fixnum?
+ (inst mov rcx x)
+ (inst or rcx y)
+ (inst test rcx 7) ; both fixnums?
(inst jmp :nz DO-STATIC-FUN) ; no - do generic
(inst jmp :nz DO-STATIC-FUN) ; no - do generic
- (inst test y 7) ; fixnum?
- (inst jmp :z DO-BODY) ; yes - doit here
+
+ ,@body
+ (inst clc)
+ (inst ret)
DO-STATIC-FUN
(inst pop rax)
DO-STATIC-FUN
(inst pop rax)
@@
-51,10
+52,7
@@
(make-ea :qword
:disp (+ nil-value
(static-fun-offset
(make-ea :qword
:disp (+ nil-value
(static-fun-offset
- ',(symbolicate "TWO-ARG-" fun)))))
-
- DO-BODY
- ,@body)))
+ ',(symbolicate "TWO-ARG-" fun))))))))
(define-generic-arith-routine (+ 10)
(move res x)
(define-generic-arith-routine (+ 10)
(move res x)