OLD | NEW |
1 //===- subzero/unittest/AssemblerX8664/LowLevel.cpp -----------------------===// | 1 //===- subzero/unittest/AssemblerX8664/LowLevel.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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 << TestString; \ | 179 << TestString; \ |
180 reset(); \ | 180 reset(); \ |
181 } while (0) | 181 } while (0) |
182 | 182 |
183 #define TestRegAbsoluteAddr(Inst, Dst, Disp, OpType, ByteCountUntyped, ...) \ | 183 #define TestRegAbsoluteAddr(Inst, Dst, Disp, OpType, ByteCountUntyped, ...) \ |
184 do { \ | 184 do { \ |
185 static constexpr char TestString[] = \ | 185 static constexpr char TestString[] = \ |
186 "(" #Inst ", " #Dst ", " #Disp ", " #OpType ", " #ByteCountUntyped \ | 186 "(" #Inst ", " #Dst ", " #Disp ", " #OpType ", " #ByteCountUntyped \ |
187 ", " #__VA_ARGS__ ")"; \ | 187 ", " #__VA_ARGS__ ")"; \ |
188 static constexpr uint8_t ByteCount = ByteCountUntyped; \ | 188 static constexpr uint8_t ByteCount = ByteCountUntyped; \ |
189 __ Inst(IceType_##OpType, Encoded_GPR_##Dst(), \ | 189 __ Inst(IceType_##OpType, Encoded_GPR_##Dst(), Address::Absolute(Disp)); \ |
190 Address(Disp, AssemblerFixup::NoFixup)); \ | |
191 ASSERT_EQ(ByteCount, codeBytesSize()) << TestString; \ | 190 ASSERT_EQ(ByteCount, codeBytesSize()) << TestString; \ |
192 ASSERT_TRUE(verifyBytes<ByteCount>(codeBytes(), __VA_ARGS__)) \ | 191 ASSERT_TRUE(verifyBytes<ByteCount>(codeBytes(), __VA_ARGS__)) \ |
193 << TestString; \ | 192 << TestString; \ |
194 reset(); \ | 193 reset(); \ |
195 } while (0) | 194 } while (0) |
196 | 195 |
197 #define TestRegAddrBase(Inst, Dst, Base, Disp, OpType, ByteCountUntyped, ...) \ | 196 #define TestRegAddrBase(Inst, Dst, Base, Disp, OpType, ByteCountUntyped, ...) \ |
198 do { \ | 197 do { \ |
199 static constexpr char TestString[] = \ | 198 static constexpr char TestString[] = \ |
200 "(" #Inst ", " #Dst ", " #Base ", " #Disp ", " #OpType \ | 199 "(" #Inst ", " #Dst ", " #Base ", " #Disp ", " #OpType \ |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 EXPECT_FLOAT_EQ(1.0f, test.contentsOfDword<float>(S0)); | 1132 EXPECT_FLOAT_EQ(1.0f, test.contentsOfDword<float>(S0)); |
1134 EXPECT_FLOAT_EQ(2.0f, test.contentsOfDword<float>(S1)); | 1133 EXPECT_FLOAT_EQ(2.0f, test.contentsOfDword<float>(S1)); |
1135 EXPECT_FLOAT_EQ(3.0f, test.contentsOfDword<float>(S2)); | 1134 EXPECT_FLOAT_EQ(3.0f, test.contentsOfDword<float>(S2)); |
1136 EXPECT_FLOAT_EQ(4.0f, test.contentsOfDword<float>(S3)); | 1135 EXPECT_FLOAT_EQ(4.0f, test.contentsOfDword<float>(S3)); |
1137 } | 1136 } |
1138 | 1137 |
1139 } // end of anonymous namespace | 1138 } // end of anonymous namespace |
1140 } // end of namespace Test | 1139 } // end of namespace Test |
1141 } // end of namespace X8664 | 1140 } // end of namespace X8664 |
1142 } // end of namespace Ice | 1141 } // end of namespace Ice |
OLD | NEW |