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

Side by Side Diff: runtime/vm/assembler_ia32_test.cc

Issue 9909024: Fix trigonometric intrinsics: if allocation fails remember to release the loaded value on FPU stack. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698