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

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

Issue 11049013: Fix movmskpd test, add masking to result. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 | « no previous file | runtime/vm/assembler_x64_test.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 EXPECT_FLOAT_EQ(-val, res, 0.001); 1792 EXPECT_FLOAT_EQ(-val, res, 0.001);
1793 val = 12.45; 1793 val = 12.45;
1794 res = reinterpret_cast<DoubleAbsCode>(entry)(val); 1794 res = reinterpret_cast<DoubleAbsCode>(entry)(val);
1795 EXPECT_FLOAT_EQ(val, res, 0.001); 1795 EXPECT_FLOAT_EQ(val, res, 0.001);
1796 } 1796 }
1797 1797
1798 1798
1799 ASSEMBLER_TEST_GENERATE(ExtractSignBits, assembler) { 1799 ASSEMBLER_TEST_GENERATE(ExtractSignBits, assembler) {
1800 __ movsd(XMM0, Address(ESP, kWordSize)); 1800 __ movsd(XMM0, Address(ESP, kWordSize));
1801 __ movmskpd(EAX, XMM0); 1801 __ movmskpd(EAX, XMM0);
1802 __ andl(EAX, Immediate(0x1));
1802 __ ret(); 1803 __ ret();
1803 } 1804 }
1804 1805
1805 1806
1806 ASSEMBLER_TEST_RUN(ExtractSignBits, entry) { 1807 ASSEMBLER_TEST_RUN(ExtractSignBits, entry) {
1807 typedef int (*ExtractSignBits)(double d); 1808 typedef int (*ExtractSignBits)(double d);
1808 int res = reinterpret_cast<ExtractSignBits>(entry)(1.0); 1809 int res = reinterpret_cast<ExtractSignBits>(entry)(1.0);
1809 EXPECT_EQ(0, res); 1810 EXPECT_EQ(0, res);
1810 res = reinterpret_cast<ExtractSignBits>(entry)(-1.0); 1811 res = reinterpret_cast<ExtractSignBits>(entry)(-1.0);
1811 EXPECT_EQ(1, res); 1812 EXPECT_EQ(1, res);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 EAX); 1980 EAX);
1980 __ popl(EAX); 1981 __ popl(EAX);
1981 __ popl(CTX); 1982 __ popl(CTX);
1982 __ ret(); 1983 __ ret();
1983 } 1984 }
1984 1985
1985 1986
1986 } // namespace dart 1987 } // namespace dart
1987 1988
1988 #endif // defined TARGET_ARCH_IA32 1989 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_x64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698