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

Side by Side Diff: runtime/vm/assembler_x64_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 | « runtime/vm/assembler_ia32_test.cc ('k') | no next file » | 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_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 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 1708
1709 ASSEMBLER_TEST_RUN(IntToDoubleConversion2, entry) { 1709 ASSEMBLER_TEST_RUN(IntToDoubleConversion2, entry) {
1710 typedef double (*IntToDoubleConversion2Code)(int i); 1710 typedef double (*IntToDoubleConversion2Code)(int i);
1711 double res = reinterpret_cast<IntToDoubleConversion2Code>(entry)(3); 1711 double res = reinterpret_cast<IntToDoubleConversion2Code>(entry)(3);
1712 EXPECT_FLOAT_EQ(3.0, res, 0.001); 1712 EXPECT_FLOAT_EQ(3.0, res, 0.001);
1713 } 1713 }
1714 1714
1715 1715
1716 ASSEMBLER_TEST_GENERATE(ExtractSignBits, assembler) { 1716 ASSEMBLER_TEST_GENERATE(ExtractSignBits, assembler) {
1717 __ movmskpd(RAX, XMM0); 1717 __ movmskpd(RAX, XMM0);
1718 __ andq(RAX, Immediate(0x1));
1718 __ ret(); 1719 __ ret();
1719 } 1720 }
1720 1721
1721 1722
1722 ASSEMBLER_TEST_RUN(ExtractSignBits, entry) { 1723 ASSEMBLER_TEST_RUN(ExtractSignBits, entry) {
1723 typedef int (*ExtractSignBits)(double d); 1724 typedef int (*ExtractSignBits)(double d);
1724 int res = reinterpret_cast<ExtractSignBits>(entry)(1.0); 1725 int res = reinterpret_cast<ExtractSignBits>(entry)(1.0);
1725 EXPECT_EQ(0, res); 1726 EXPECT_EQ(0, res);
1726 res = reinterpret_cast<ExtractSignBits>(entry)(-1.0); 1727 res = reinterpret_cast<ExtractSignBits>(entry)(-1.0);
1727 EXPECT_EQ(1, res); 1728 EXPECT_EQ(1, res);
1728 res = reinterpret_cast<ExtractSignBits>(entry)(-0.0); 1729 res = reinterpret_cast<ExtractSignBits>(entry)(-0.0);
1729 EXPECT_EQ(1, res); 1730 EXPECT_EQ(1, res);
1730 } 1731 }
1731 1732
1732 } // namespace dart 1733 } // namespace dart
1733 1734
1734 #endif // defined TARGET_ARCH_X64 1735 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698