Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
cmucl
cmucl
Commits
3c67abd3
Commit
3c67abd3
authored
Jul 14, 2004
by
cwang
Browse files
Since linkage table will trash r11, make sure it's used as the temp register for allocation
parent
b96d74be
Changes
9
Hide whitespace changes
Inline
Side-by-side
assembly/amd64/arith.lisp
View file @
3c67abd3
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/amd64/arith.lisp,v 1.
1
2004/0
5/21 22:46
:4
3
cwang
Exp
$"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/amd64/arith.lisp,v 1.
2
2004/0
7/14 20:51
:4
9
cwang
Rel
$"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -39,7 +39,8 @@
(
:temp
rax
unsigned-reg
rax-offset
)
(
:temp
rbx
unsigned-reg
rbx-offset
)
(
:temp
rcx
unsigned-reg
rcx-offset
))
(
:temp
rcx
unsigned-reg
rcx-offset
)
(
:temp
r11
unsigned-reg
r11-offset
))
(
inst
test
x
3
)
; fixnum?
(
inst
jmp
:nz
DO-STATIC-FUN
)
; no - do generic
...
...
@@ -72,7 +73,7 @@
(
move
rcx
res
)
(
with-fixed-allocation
(
res
bignum-type
(
1+
bignum-digits-offset
)
r
ax
)
(
with-fixed-allocation
(
res
bignum-type
(
1+
bignum-digits-offset
)
r
11
)
(
storew
rcx
res
bignum-digits-offset
other-pointer-type
))
OKAY
)
...
...
@@ -93,7 +94,7 @@
(
move
rcx
res
)
(
with-fixed-allocation
(
res
bignum-type
(
1+
bignum-digits-offset
)
r
ax
)
(
with-fixed-allocation
(
res
bignum-type
(
1+
bignum-digits-offset
)
r
11
)
(
storew
rcx
res
bignum-digits-offset
other-pointer-type
))
OKAY
)
...
...
@@ -114,14 +115,14 @@
(
inst
cmp
x
rcx
)
(
inst
jmp
:e
SINGLE-WORD-BIGNUM
)
(
with-fixed-allocation
(
res
bignum-type
(
+
bignum-digits-offset
2
)
r
bx
)
(
with-fixed-allocation
(
res
bignum-type
(
+
bignum-digits-offset
2
)
r
11
)
(
storew
rax
res
bignum-digits-offset
other-pointer-type
)
(
storew
rcx
res
(
1+
bignum-digits-offset
)
other-pointer-type
))
(
inst
jmp
DONE
)
SINGLE-WORD-BIGNUM
(
with-fixed-allocation
(
res
bignum-type
(
1+
bignum-digits-offset
)
r
bx
)
(
with-fixed-allocation
(
res
bignum-type
(
1+
bignum-digits-offset
)
r
11
)
(
storew
rax
res
bignum-digits-offset
other-pointer-type
))
(
inst
jmp
DONE
)
...
...
@@ -139,7 +140,8 @@
(
:res
res
(
descriptor-reg
any-reg
)
rdx-offset
)
(
:temp
rax
unsigned-reg
rax-offset
)
(
:temp
rcx
unsigned-reg
rcx-offset
))
(
:temp
rcx
unsigned-reg
rcx-offset
)
(
:temp
r11
unsigned-reg
r11-offset
))
(
inst
test
x
3
)
(
inst
jmp
:z
FIXNUM
)
...
...
@@ -159,7 +161,7 @@
(
inst
shr
res
2
)
; sign bit is data - remove type bits
(
move
rcx
res
)
(
with-fixed-allocation
(
res
bignum-type
(
1+
bignum-digits-offset
)
r
ax
)
(
with-fixed-allocation
(
res
bignum-type
(
1+
bignum-digits-offset
)
r
11
)
(
storew
rcx
res
bignum-digits-offset
other-pointer-type
))
OKAY
)
...
...
assembly/amd64/array.lisp
View file @
3c67abd3
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/amd64/array.lisp,v 1.
1
2004/0
5/21 22:46
:4
3
cwang Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/amd64/array.lisp,v 1.
2
2004/0
7/14 20:51
:4
9
cwang Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -32,7 +32,7 @@
((
:arg
type
unsigned-reg
rax-offset
)
(
:arg
length
any-reg
rbx-offset
)
(
:arg
words
any-reg
rcx-offset
)
(
:temp
temp
any-reg
r
di
-offset
)
(
:temp
temp
any-reg
r
11
-offset
)
(
:res
result
descriptor-reg
rdx-offset
))
;; compute the number of bytes
;; words is a fixnum
...
...
compiler/amd64/alloc.lisp
View file @
3c67abd3
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/alloc.lisp,v 1.
3
2004/07/
06
20:
09:05
cwang
Exp
$"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/alloc.lisp,v 1.
4
2004/07/
14
20:
56:24
cwang
Rel
$"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -45,7 +45,8 @@
(
define-vop
(
list-or-list*
)
(
:args
(
things
:more
t
))
(
:temporary
(
:sc
unsigned-reg
)
ptr
temp
)
(
:temporary
(
:sc
unsigned-reg
)
ptr
)
(
:temporary
(
:sc
unsigned-reg
:offset
r11-offset
)
temp
)
(
:temporary
(
:sc
unsigned-reg
:to
(
:result
0
)
:target
result
)
res
)
(
:info
num
dynamic-extent
)
(
:results
(
result
:scs
(
descriptor-reg
)))
...
...
@@ -139,7 +140,7 @@
(
:results
(
result
:scs
(
descriptor-reg
)
:from
:eval
))
(
:temporary
(
:sc
unsigned-reg
:from
(
:argument
0
))
boxed
)
(
:temporary
(
:sc
unsigned-reg
:from
(
:argument
1
))
unboxed
)
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:node-var
node
)
(
:generator
100
(
move
boxed
boxed-arg
)
...
...
@@ -170,7 +171,7 @@
(
:translate
make-fdefn
)
(
:args
(
name
:scs
(
descriptor-reg
)
:to
:eval
))
(
:results
(
result
:scs
(
descriptor-reg
)
:from
:argument
))
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:node-var
node
)
(
:generator
37
(
with-fixed-allocation
(
result
fdefn-type
fdefn-size
temp
node
)
...
...
@@ -184,7 +185,7 @@
(
define-vop
(
make-closure
)
(
:args
(
function
:to
:save
:scs
(
descriptor-reg
)))
(
:info
length
dynamic-extent
)
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:results
(
result
:scs
(
descriptor-reg
)))
(
:node-var
node
)
(
:generator
10
...
...
@@ -205,7 +206,7 @@
(
define-vop
(
make-value-cell
)
(
:args
(
value
:scs
(
descriptor-reg
any-reg
)
:to
:result
))
(
:results
(
result
:scs
(
descriptor-reg
)
:from
:eval
))
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:node-var
node
)
(
:generator
10
(
with-fixed-allocation
...
...
@@ -227,7 +228,7 @@
(
:info
name
words
type
lowtag
dynamic-extent
)
(
:ignore
name
)
(
:results
(
result
:scs
(
descriptor-reg
)))
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:node-var
node
)
(
:generator
50
(
let
((
*enable-pseudo-atomic*
(
unless
dynamic-extent
...
...
@@ -246,7 +247,7 @@
(
:results
(
result
:scs
(
descriptor-reg
)
:from
(
:eval
1
)))
(
:temporary
(
:sc
any-reg
:from
:eval
:to
(
:eval
1
))
bytes
)
(
:temporary
(
:sc
any-reg
:from
:eval
:to
:result
)
header
)
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:node-var
node
)
(
:generator
50
(
inst
lea
bytes
...
...
compiler/amd64/array.lisp
View file @
3c67abd3
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/array.lisp,v 1.
1
2004/0
5/24 22:34:59
cwang
Exp
$"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/array.lisp,v 1.
2
2004/0
7/14 20:56:24
cwang
Rel
$"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -32,7 +32,7 @@
(
:arg-types
positive-fixnum
positive-fixnum
)
(
:temporary
(
:sc
any-reg
:to
:eval
)
bytes
)
(
:temporary
(
:sc
any-reg
:to
:result
)
header
)
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:results
(
result
:scs
(
descriptor-reg
)
:from
:eval
))
(
:node-var
node
)
(
:generator
13
...
...
compiler/amd64/call.lisp
View file @
3c67abd3
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/call.lisp,v 1.
3
2004/07/
08 17:32:30
cwang Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/call.lisp,v 1.
4
2004/07/
14 20:56:24
cwang Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -1369,6 +1369,7 @@
(
:temporary
(
:sc
unsigned-reg
:offset
rsi-offset
:from
(
:argument
0
))
src
)
(
:temporary
(
:sc
unsigned-reg
:offset
rcx-offset
:from
(
:argument
1
))
rcx
)
(
:temporary
(
:sc
unsigned-reg
:offset
rax-offset
)
rax
)
(
:temporary
(
:sc
unsigned-reg
:offset
r11-offset
)
r11
)
(
:temporary
(
:sc
unsigned-reg
)
dst
)
(
:results
(
result
:scs
(
descriptor-reg
)))
(
:node-var
node
)
...
...
@@ -1385,7 +1386,7 @@
(
let
((
*enable-pseudo-atomic*
(
unless
dynamic-extent
*enable-pseudo-atomic*
)))
(
pseudo-atomic
(
allocation
dst
dst
r
ax
node
dynamic-extent
)
(
allocation
dst
dst
r
11
node
dynamic-extent
)
(
inst
lea
dst
(
make-ea
:byte
:base
dst
:disp
list-pointer-type
))
;; Convert the count into a raw value, so we can use the LOOP inst.
(
inst
shr
rcx
2
)
...
...
compiler/amd64/float.lisp
View file @
3c67abd3
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/float.lisp,v 1.
1
2004/0
5/24 22:34:59
cwang
Exp
$"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/float.lisp,v 1.
2
2004/0
7/14 20:57:31
cwang
Rel
$"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -404,7 +404,7 @@
(
define-vop
(
move-from-single
)
(
:args
(
x
:scs
(
single-reg
)
:to
:save
))
(
:results
(
y
:scs
(
descriptor-reg
)))
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:node-var
node
)
(
:note
"float to pointer coercion"
)
(
:generator
13
...
...
@@ -417,7 +417,7 @@
(
define-vop
(
move-from-double
)
(
:args
(
x
:scs
(
double-reg
)
:to
:save
))
(
:results
(
y
:scs
(
descriptor-reg
)))
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:node-var
node
)
(
:note
"float to pointer coercion"
)
(
:generator
13
...
...
@@ -509,7 +509,7 @@
(
define-vop
(
move-from-complex-single
)
(
:args
(
x
:scs
(
complex-single-reg
)
:to
:save
))
(
:results
(
y
:scs
(
descriptor-reg
)))
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:node-var
node
)
(
:note
"complex float to pointer coercion"
)
(
:generator
13
...
...
@@ -527,7 +527,7 @@
(
define-vop
(
move-from-complex-double
)
(
:args
(
x
:scs
(
complex-double-reg
)
:to
:save
))
(
:results
(
y
:scs
(
descriptor-reg
)))
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:node-var
node
)
(
:note
"complex float to pointer coercion"
)
(
:generator
13
...
...
compiler/amd64/macros.lisp
View file @
3c67abd3
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/macros.lisp,v 1.
3
2004/07/
06
20:
1
8:4
2
cwang Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/macros.lisp,v 1.
4
2004/07/
14
20:
5
8:4
5
cwang Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -168,6 +168,8 @@
(
inst
mov
dst-tn
size
)))
(
defun
inline-allocation
(
alloc-tn
size
temp-tn
)
;; Since linkage table will trash r11, the easiest solution is to make sure temp-tn is r11
(
assert
(
=
(
tn-offset
temp-tn
)
#.
r11-offset
))
(
let
((
ok
(
gen-label
)))
;;
;; Load the size first so that the size can be in the same
...
...
@@ -194,7 +196,7 @@
(
#.
r8-offset
"alloc_overflow_r8"
)
(
#.
r9-offset
"alloc_overflow_r9"
)
(
#.
r10-offset
"alloc_overflow_r10"
)
(
#.
r11-offset
"alloc_overflow_
r11
"
)
;; no
r11
(
#.
r12-offset
"alloc_overflow_r12"
)
(
#.
r13-offset
"alloc_overflow_r13"
)
(
#.
r14-offset
"alloc_overflow_r14"
)
...
...
compiler/amd64/move.lisp
View file @
3c67abd3
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/move.lisp,v 1.
3
2004/07/
06
20:
1
9:
5
8 cwang
Exp
$"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/move.lisp,v 1.
4
2004/07/
14
20:
5
9:
4
8 cwang
Rel
$"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -289,28 +289,11 @@
;;; Result may be a bignum, so we have to check. Use a worst-case cost to make
;;; sure people know they may be number consing.
;;;
#+
nil
(
define-vop
(
move-from-signed
)
(
:args
(
x
:scs
(
signed-reg
unsigned-reg
)
:target
rax
))
(
:temporary
(
:sc
unsigned-reg
:offset
rax-offset
:from
(
:argument
0
))
rax
)
(
:temporary
(
:sc
unsigned-reg
:offset
rbx-offset
:to
(
:result
0
)
:target
y
)
rbx
)
(
:temporary
(
:sc
unsigned-reg
:offset
rcx-offset
:from
(
:argument
0
)
:to
(
:result
0
))
rcx
)
(
:ignore
rcx
)
(
:results
(
y
:scs
(
any-reg
descriptor-reg
)))
(
:note
"signed word to integer coercion"
)
(
:generator
20
(
move
rax
x
)
(
inst
call
(
make-fixup
'move-from-signed
:assembly-routine
))
(
move
y
rbx
)))
;;;
;;; Faster inline version,
(
define-vop
(
move-from-signed
)
(
:args
(
x
:scs
(
signed-reg
unsigned-reg
)
:to
:result
))
(
:results
(
y
:scs
(
any-reg
descriptor-reg
)
:from
:argument
))
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:note
"signed word to integer coercion"
)
(
:node-var
node
)
(
:generator
20
...
...
@@ -337,27 +320,11 @@
;;; Check for fixnum, and possibly allocate one or two word bignum result. Use
;;; a worst-case cost to make sure people know they may be number consing.
;;;
#+
nil
(
define-vop
(
move-from-unsigned
)
(
:args
(
x
:scs
(
signed-reg
unsigned-reg
)
:target
rax
))
(
:temporary
(
:sc
unsigned-reg
:offset
rax-offset
:from
(
:argument
0
))
rax
)
(
:temporary
(
:sc
unsigned-reg
:offset
rbx-offset
:to
(
:result
0
)
:target
y
)
rbx
)
(
:temporary
(
:sc
unsigned-reg
:offset
rcx-offset
:from
(
:argument
0
)
:to
(
:result
0
))
rcx
)
(
:ignore
rcx
)
(
:results
(
y
:scs
(
any-reg
descriptor-reg
)))
(
:note
"unsigned word to integer coercion"
)
(
:generator
20
(
move
rax
x
)
(
inst
call
(
make-fixup
'move-from-unsigned
:assembly-routine
))
(
move
y
rbx
)))
;;;
;;; Faster inline version.
(
define-vop
(
move-from-unsigned
)
(
:args
(
x
:scs
(
signed-reg
unsigned-reg
)
:to
:save
))
(
:temporary
(
:sc
unsigned-reg
)
alloc
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:results
(
y
:scs
(
any-reg
descriptor-reg
)))
(
:node-var
node
)
(
:note
"unsigned word to integer coercion"
)
...
...
@@ -391,11 +358,7 @@
bignum-type
))
(
emit-label
l1
)
(
pseudo-atomic
;; We don't have enough registers. So I'm using y here
;; We can fix it when we use r8-r15
(
inst
push
y
)
(
allocation
alloc
(
pad-data-block
(
+
bignum-digits-offset
2
))
y
node
)
(
inst
pop
y
)
(
allocation
alloc
(
pad-data-block
(
+
bignum-digits-offset
2
))
temp
node
)
(
storew
y
alloc
)
(
inst
lea
y
(
make-ea
:byte
:base
alloc
:disp
other-pointer-type
))
(
storew
x
y
bignum-digits-offset
other-pointer-type
))
...
...
compiler/amd64/sap.lisp
View file @
3c67abd3
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/sap.lisp,v 1.
2
2004/0
6
/1
0 01:45:39
cwang
Exp
$"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/sap.lisp,v 1.
3
2004/0
7
/1
4 21:00:17
cwang
Rel
$"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -41,7 +41,7 @@
(
define-vop
(
move-from-sap
)
(
:args
(
sap
:scs
(
sap-reg
)
:to
:result
))
(
:results
(
res
:scs
(
descriptor-reg
)
:from
:argument
))
(
:temporary
(
:sc
any-reg
)
temp
)
(
:temporary
(
:sc
any-reg
:offset
r11-offset
)
temp
)
(
:note
"SAP to pointer coercion"
)
(
:node-var
node
)
(
:generator
20
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment