| 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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 typedef float (*CosineCode)(float f); | 1277 typedef float (*CosineCode)(float f); |
| 1278 const float kFloatConst = 0.7; | 1278 const float kFloatConst = 0.7; |
| 1279 float res = reinterpret_cast<CosineCode>(entry)(kFloatConst); | 1279 float res = reinterpret_cast<CosineCode>(entry)(kFloatConst); |
| 1280 EXPECT_FLOAT_EQ(cos(kFloatConst), res, 0.0001); | 1280 EXPECT_FLOAT_EQ(cos(kFloatConst), res, 0.0001); |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 | 1283 |
| 1284 ASSEMBLER_TEST_GENERATE(Tangent, assembler) { | 1284 ASSEMBLER_TEST_GENERATE(Tangent, assembler) { |
| 1285 __ fldl(Address(ESP, kWordSize)); | 1285 __ fldl(Address(ESP, kWordSize)); |
| 1286 __ fptan(); | 1286 __ fptan(); |
| 1287 __ ffree(Immediate(0)); | 1287 __ ffree(0); |
| 1288 __ fincstp(); | 1288 __ fincstp(); |
| 1289 __ ret(); | 1289 __ ret(); |
| 1290 } | 1290 } |
| 1291 | 1291 |
| 1292 | 1292 |
| 1293 ASSEMBLER_TEST_RUN(Tangent, entry) { | 1293 ASSEMBLER_TEST_RUN(Tangent, entry) { |
| 1294 typedef double (*TangentCode)(double d); | 1294 typedef double (*TangentCode)(double d); |
| 1295 const double kDoubleConst = 0.6108652375000001; | 1295 const double kDoubleConst = 0.6108652375000001; |
| 1296 double res = reinterpret_cast<TangentCode>(entry)(kDoubleConst); | 1296 double res = reinterpret_cast<TangentCode>(entry)(kDoubleConst); |
| 1297 EXPECT_FLOAT_EQ(tan(kDoubleConst), res, 0.0001); | 1297 EXPECT_FLOAT_EQ(tan(kDoubleConst), res, 0.0001); |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1833 ASSEMBLER_TEST_RUN(TestAlignLarge, entry) { | 1833 ASSEMBLER_TEST_RUN(TestAlignLarge, entry) { |
| 1834 typedef int (*TestAlignLarge)(); | 1834 typedef int (*TestAlignLarge)(); |
| 1835 int res = reinterpret_cast<TestAlignLarge>(entry)(); | 1835 int res = reinterpret_cast<TestAlignLarge>(entry)(); |
| 1836 EXPECT_EQ(16, res); // 16 bytes emitted. | 1836 EXPECT_EQ(16, res); // 16 bytes emitted. |
| 1837 } | 1837 } |
| 1838 | 1838 |
| 1839 | 1839 |
| 1840 } // namespace dart | 1840 } // namespace dart |
| 1841 | 1841 |
| 1842 #endif // defined TARGET_ARCH_IA32 | 1842 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |