Commit d4cc50e1 authored by lrn@chromium.org's avatar lrn@chromium.org

X64: Remove restriction on using r12 as index register.

Review URL: http://codereview.chromium.org/126045


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2155 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e2fdac39
......@@ -260,7 +260,8 @@ void Operand::set_modrm(int mod, Register rm) {
void Operand::set_sib(ScaleFactor scale, Register index, Register base) {
ASSERT(len_ == 1);
ASSERT(is_uint2(scale));
// Use SIB with no index register only for base rsp or r12.
// Use SIB with no index register only for base rsp or r12. Otherwise we
// would skip the SIB byte entirely.
ASSERT(!index.is(rsp) || base.is(rsp) || base.is(r12));
buf_[1] = scale << 6 | (index.code() & 0x7) << 3 | (base.code() & 0x7);
rex_ |= (index.code() >> 3) << 1 | base.code() >> 3;
......
......@@ -96,12 +96,12 @@ Operand::Operand(Register base,
Register index,
ScaleFactor scale,
int32_t disp): rex_(0) {
ASSERT(!index.is(rsp) && !index.is(r12));
ASSERT(!index.is(rsp));
len_ = 1;
set_sib(scale, index, base);
if (disp == 0 && !base.is(rbp) && !base.is(r13)) {
// The call to set_modrm doesn't overwrite the REX.B bit possibly set
// by set_sib.
// This call to set_modrm doesn't overwrite the REX.B (or REX.X) bits
// possibly set by set_sib.
set_modrm(0, rsp);
} else if (is_int8(disp)) {
set_modrm(1, rsp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment