Raymond Toy pushed to branch rtoy-amd64-p1 at cmucl / cmucl
Commits: 4f8e35c9 by Raymond Toy at 2020-08-15T10:36:10-07:00 emit-ea needs to support float-registers
emit-ea with a tn arg needs to recognize a float-register. The x86 port does this so we just copied it over.
- - - - - b626b6ff by Raymond Toy at 2020-08-16T12:14:13-07:00 Allow using R12 in emit-ea
Currently R12 is not allowed as an index register (a carry over from x86 because R12 is ESP when looking at the low 3 bits of the register). However, if we emit the appropriate REX prefix, then I think R12 is ok to use here. Just assume REX was emitted and allow use of R12 for now.
- - - - -
1 changed file:
- src/compiler/amd64/insts.lisp
Changes:
===================================== src/compiler/amd64/insts.lisp ===================================== @@ -150,7 +150,7 @@ (etypecase thing (tn (ecase (sb-name (sc-sb (tn-sc thing))) - (registers + ((registers float-registers) (emit-mod-reg-r/m-byte segment #b11 reg (reg-lower-3-bits thing))) (stack ;; Convert stack tns into an index off of RBP. @@ -188,9 +188,15 @@ (let ((ss (1- (integer-length scale))) (index (if (null index) #b100 + ;; FIXME: We're going to assume this is ok + ;; for now because we emitted an appropriate + ;; REX prefix already to allow using R12 + ;; here. + #+nil (if (= (reg-tn-encoding index) #b100) (error "Can't index off of RSP") - (reg-lower-3-bits index)))) + (reg-lower-3-bits index)) + (reg-lower-3-bits index))) (base (if (null base) #b101 (reg-lower-3-bits base))))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/26a395fd35b99ec9c9e78ef...