| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/os.h" | 9 #include "vm/os.h" |
| 10 #include "vm/unit_test.h" | 10 #include "vm/unit_test.h" |
| (...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 } | 1227 } |
| 1228 | 1228 |
| 1229 | 1229 |
| 1230 ASSEMBLER_TEST_RUN(TestAdds, entry) { | 1230 ASSEMBLER_TEST_RUN(TestAdds, entry) { |
| 1231 typedef int (*TestAdds)(); | 1231 typedef int (*TestAdds)(); |
| 1232 int res = reinterpret_cast<TestAdds>(entry)(); | 1232 int res = reinterpret_cast<TestAdds>(entry)(); |
| 1233 EXPECT_EQ(10, res); | 1233 EXPECT_EQ(10, res); |
| 1234 } | 1234 } |
| 1235 | 1235 |
| 1236 | 1236 |
| 1237 ASSEMBLER_TEST_GENERATE(TestNot, assembler) { |
| 1238 __ movq(RAX, Immediate(0xFFFFFFFF00000000)); |
| 1239 __ notq(RAX); |
| 1240 __ ret(); |
| 1241 } |
| 1242 |
| 1243 |
| 1244 ASSEMBLER_TEST_RUN(TestNot, entry) { |
| 1245 typedef int (*TestNot)(); |
| 1246 unsigned int res = reinterpret_cast<TestNot>(entry)(); |
| 1247 EXPECT_EQ(0xFFFFFFFF, res); |
| 1248 } |
| 1249 |
| 1250 |
| 1251 ASSEMBLER_TEST_GENERATE(XorpdZeroing, assembler) { |
| 1252 __ movsd(XMM0, Address(RSP, kWordSize)); |
| 1253 __ xorpd(XMM0, Address(RSP, kWordSize)); |
| 1254 __ movq(RAX, Immediate(999)); |
| 1255 __ ret(); |
| 1256 } |
| 1257 |
| 1258 |
| 1259 ASSEMBLER_TEST_RUN(XorpdZeroing, entry) { |
| 1260 typedef double (*XorpdZeroingCode)(double d); |
| 1261 double res = reinterpret_cast<XorpdZeroingCode>(entry)(12.56e3); |
| 1262 EXPECT_FLOAT_EQ(0.0, res, 0.0001); |
| 1263 } |
| 1264 |
| 1237 } // namespace dart | 1265 } // namespace dart |
| 1238 | 1266 |
| 1239 #endif // defined TARGET_ARCH_X64 | 1267 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |