summaryrefslogtreecommitdiffstats
path: root/compiler/utils/x86_64/assembler_x86_64.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils/x86_64/assembler_x86_64.h')
-rw-r--r--compiler/utils/x86_64/assembler_x86_64.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/utils/x86_64/assembler_x86_64.h b/compiler/utils/x86_64/assembler_x86_64.h
index e24fa1b..2fc251b 100644
--- a/compiler/utils/x86_64/assembler_x86_64.h
+++ b/compiler/utils/x86_64/assembler_x86_64.h
@@ -180,18 +180,18 @@ class Address : public Operand {
void Init(CpuRegister base_in, int32_t disp) {
if (disp == 0 && base_in.LowBits() != RBP) {
SetModRM(0, base_in);
- if (base_in.AsRegister() == RSP) {
+ if (base_in.LowBits() == RSP) {
SetSIB(TIMES_1, CpuRegister(RSP), base_in);
}
} else if (disp >= -128 && disp <= 127) {
SetModRM(1, base_in);
- if (base_in.AsRegister() == RSP) {
+ if (base_in.LowBits() == RSP) {
SetSIB(TIMES_1, CpuRegister(RSP), base_in);
}
SetDisp8(disp);
} else {
SetModRM(2, base_in);
- if (base_in.AsRegister() == RSP) {
+ if (base_in.LowBits() == RSP) {
SetSIB(TIMES_1, CpuRegister(RSP), base_in);
}
SetDisp32(disp);