Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Unified Diff: unittest/AssemblerX8664/GPRArith.cpp

Issue 1537703002: Subzero. x8664. Resurrects the Target. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: unittest/AssemblerX8664/GPRArith.cpp
diff --git a/unittest/AssemblerX8664/GPRArith.cpp b/unittest/AssemblerX8664/GPRArith.cpp
index 09f29f70dec456d84e393df0660660669d0ec178..2ec85cc5aa5208542f4e8ec0c76ca55ffb8f4f01 100644
--- a/unittest/AssemblerX8664/GPRArith.cpp
+++ b/unittest/AssemblerX8664/GPRArith.cpp
@@ -329,15 +329,18 @@ TEST_F(AssemblerX8664LowLevelTest, LeaAbsolute) {
static constexpr char TestString[] = "(" #Dst ", " #Value ")"; \
__ lea(IceType_i32, GPRRegister::Encoded_Reg_##Dst, \
Address(Value, AssemblerFixup::NoFixup)); \
- static constexpr uint32_t ByteCount = 6; \
+ static constexpr uint32_t ByteCount = 8; \
ASSERT_EQ(ByteCount, codeBytesSize()) << TestString; \
static constexpr uint8_t Opcode = 0x8D; \
static constexpr uint8_t ModRM = \
- /*mod=*/0x00 | /*reg*/ (GPRRegister::Encoded_Reg_##Dst << 3) | \
- /*rm*/ GPRRegister::Encoded_Reg_ebp; \
+ /*mod*/ 0x00 | /*reg*/ (GPRRegister::Encoded_Reg_##Dst << 3) | \
+ /*rm*/ GPRRegister::Encoded_Reg_esp; \
+ static constexpr uint8_t SIB = \
+ /*Scale*/ 0x00 | /*Index*/ (GPRRegister::Encoded_Reg_esp << 3) | \
+ /*base*/ GPRRegister::Encoded_Reg_ebp; \
ASSERT_TRUE(verifyBytes<ByteCount>( \
- codeBytes(), Opcode, ModRM, (Value)&0xFF, (Value >> 8) & 0xFF, \
- (Value >> 16) & 0xFF, (Value >> 24) & 0xFF)); \
+ codeBytes(), 0x67, Opcode, ModRM, SIB, (Value)&0xFF, \
+ (Value >> 8) & 0xFF, (Value >> 16) & 0xFF, (Value >> 24) & 0xFF)); \
reset(); \
} while (0)

Powered by Google App Engine
This is Rietveld 408576698