}
void Init(CpuRegister base_in, int32_t disp) {
- if (disp == 0 && base_in.AsRegister() != RBP) {
+ if (disp == 0 && base_in.LowBits() != RBP) {
SetModRM(0, base_in);
if (base_in.LowBits() == RSP) {
SetSIB(TIMES_1, CpuRegister(RSP), base_in);
Address(CpuRegister base_in, CpuRegister index_in, ScaleFactor scale_in, int32_t disp) {
CHECK_NE(index_in.AsRegister(), RSP); // Illegal addressing mode.
- if (disp == 0 && base_in.AsRegister() != RBP) {
+ if (disp == 0 && base_in.LowBits() != RBP) {
SetModRM(0, CpuRegister(RSP));
SetSIB(scale_in, index_in, base_in);
} else if (disp >= -128 && disp <= 127) {
x86_64::CpuRegister(x86_64::RDI), x86_64::CpuRegister(x86_64::R9), x86_64::TIMES_4, 12));
GetAssembler()->movl(x86_64::CpuRegister(x86_64::R8), x86_64::Address(
x86_64::CpuRegister(x86_64::RDI), x86_64::CpuRegister(x86_64::R9), x86_64::TIMES_4, 12));
+ GetAssembler()->movl(x86_64::CpuRegister(x86_64::RAX), x86_64::Address(
+ x86_64::CpuRegister(x86_64::R13), 0));
+ GetAssembler()->movl(x86_64::CpuRegister(x86_64::RAX), x86_64::Address(
+ x86_64::CpuRegister(x86_64::R13), x86_64::CpuRegister(x86_64::R9), x86_64::TIMES_1, 0));
const char* expected =
"movl 0xc(%RDI,%RBX,4), %EAX\n"
"movl 0xc(%RDI,%R9,4), %EAX\n"
- "movl 0xc(%RDI,%R9,4), %R8d\n";
+ "movl 0xc(%RDI,%R9,4), %R8d\n"
+ "movl (%R13), %EAX\n"
+ "movl (%R13,%R9,1), %EAX\n";
DriverStr(expected, "movl");
}