OLD | NEW |
1 //===- subzero/unittest/AssemblerX8664/GPRArith.cpp -----------------------===// | 1 //===- subzero/unittest/AssemblerX8664/GPRArith.cpp -----------------------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 #include "AssemblerX8664/TestUtil.h" | 9 #include "AssemblerX8664/TestUtil.h" |
10 | 10 |
(...skipping 310 matching lines...) Loading... |
321 #undef TestLeaBaseIndexDisp | 321 #undef TestLeaBaseIndexDisp |
322 #undef TestLeaScaled32bitDisp | 322 #undef TestLeaScaled32bitDisp |
323 #undef TestLeaBaseDisp | 323 #undef TestLeaBaseDisp |
324 } | 324 } |
325 | 325 |
326 TEST_F(AssemblerX8664LowLevelTest, LeaAbsolute) { | 326 TEST_F(AssemblerX8664LowLevelTest, LeaAbsolute) { |
327 #define TestLeaAbsolute(Dst, Value) \ | 327 #define TestLeaAbsolute(Dst, Value) \ |
328 do { \ | 328 do { \ |
329 static constexpr char TestString[] = "(" #Dst ", " #Value ")"; \ | 329 static constexpr char TestString[] = "(" #Dst ", " #Value ")"; \ |
330 __ lea(IceType_i32, GPRRegister::Encoded_Reg_##Dst, \ | 330 __ lea(IceType_i32, GPRRegister::Encoded_Reg_##Dst, \ |
331 Address(Value, AssemblerFixup::NoFixup)); \ | 331 Address::Absolute(Value)); \ |
332 static constexpr uint32_t ByteCount = 8; \ | 332 static constexpr uint32_t ByteCount = 8; \ |
333 ASSERT_EQ(ByteCount, codeBytesSize()) << TestString; \ | 333 ASSERT_EQ(ByteCount, codeBytesSize()) << TestString; \ |
334 static constexpr uint8_t Opcode = 0x8D; \ | 334 static constexpr uint8_t Opcode = 0x8D; \ |
335 static constexpr uint8_t ModRM = \ | 335 static constexpr uint8_t ModRM = \ |
336 /*mod*/ 0x00 | /*reg*/ (GPRRegister::Encoded_Reg_##Dst << 3) | \ | 336 /*mod*/ 0x00 | /*reg*/ (GPRRegister::Encoded_Reg_##Dst << 3) | \ |
337 /*rm*/ GPRRegister::Encoded_Reg_esp; \ | 337 /*rm*/ GPRRegister::Encoded_Reg_esp; \ |
338 static constexpr uint8_t SIB = \ | 338 static constexpr uint8_t SIB = \ |
339 /*Scale*/ 0x00 | /*Index*/ (GPRRegister::Encoded_Reg_esp << 3) | \ | 339 /*Scale*/ 0x00 | /*Index*/ (GPRRegister::Encoded_Reg_esp << 3) | \ |
340 /*base*/ GPRRegister::Encoded_Reg_ebp; \ | 340 /*base*/ GPRRegister::Encoded_Reg_ebp; \ |
341 ASSERT_TRUE(verifyBytes<ByteCount>( \ | 341 ASSERT_TRUE(verifyBytes<ByteCount>( \ |
(...skipping 1562 matching lines...) Loading... |
1904 #undef TestImplValue | 1904 #undef TestImplValue |
1905 #undef TestImplSize | 1905 #undef TestImplSize |
1906 #undef TestImplRegAddr | 1906 #undef TestImplRegAddr |
1907 #undef TestImplRegReg | 1907 #undef TestImplRegReg |
1908 } | 1908 } |
1909 | 1909 |
1910 } // end of anonymous namespace | 1910 } // end of anonymous namespace |
1911 } // end of namespace Test | 1911 } // end of namespace Test |
1912 } // end of namespace X8664 | 1912 } // end of namespace X8664 |
1913 } // end of namespace Ice | 1913 } // end of namespace Ice |
OLD | NEW |