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

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

Issue 10968059: Support for unboxed 64-bit integer bitwise operations and equality on ia32. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments, added tests and flags 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
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 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 } 1648 }
1649 1649
1650 1650
1651 ASSEMBLER_TEST_RUN(XorpdZeroing, entry) { 1651 ASSEMBLER_TEST_RUN(XorpdZeroing, entry) {
1652 typedef double (*XorpdZeroingCode)(double d); 1652 typedef double (*XorpdZeroingCode)(double d);
1653 double res = reinterpret_cast<XorpdZeroingCode>(entry)(12.56e3); 1653 double res = reinterpret_cast<XorpdZeroingCode>(entry)(12.56e3);
1654 EXPECT_FLOAT_EQ(0.0, res, 0.0001); 1654 EXPECT_FLOAT_EQ(0.0, res, 0.0001);
1655 } 1655 }
1656 1656
1657 1657
1658 ASSEMBLER_TEST_GENERATE(Orpd, assembler) {
srdjan 2012/09/28 16:50:26 Disable appropriate tests if SSE4_1 not supported
Florian Schneider 2012/10/02 11:10:31 I added tests for the 4.1 specific instructions. T
1659 __ movsd(XMM0, Address(ESP, kWordSize));
1660 __ xorpd(XMM1, XMM1);
1661 __ DoubleNegate(XMM1);
1662 __ orpd(XMM0, XMM1);
1663 __ pushl(EAX);
1664 __ pushl(EAX);
1665 __ movsd(Address(ESP, 0), XMM0);
1666 __ fldl(Address(ESP, 0));
1667 __ popl(EAX);
1668 __ popl(EAX);
1669 __ ret();
1670 }
1671
1672
1673 ASSEMBLER_TEST_RUN(Orpd, entry) {
1674 typedef double (*OrpdCode)(double d);
1675 double res = reinterpret_cast<OrpdCode>(entry)(12.56e3);
1676 EXPECT_FLOAT_EQ(-12.56e3, res, 0.0);
1677 }
1678
1679
1680 ASSEMBLER_TEST_GENERATE(AndPd, assembler) {
1681 __ movsd(XMM0, Address(ESP, kWordSize));
1682 __ andpd(XMM0, XMM0);
1683 __ pushl(EAX);
1684 __ pushl(EAX);
1685 __ movsd(Address(ESP, 0), XMM0);
1686 __ fldl(Address(ESP, 0));
1687 __ popl(EAX);
1688 __ popl(EAX);
1689 __ ret();
1690 }
1691
1692
1693 ASSEMBLER_TEST_RUN(AndPd, entry) {
1694 typedef double (*AndpdCode)(double d);
1695 double res = reinterpret_cast<AndpdCode>(entry)(12.56e3);
1696 EXPECT_FLOAT_EQ(12.56e3, res, 0.0);
1697 }
1698
1699
1658 ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) { 1700 ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) {
1659 __ movsd(XMM0, Address(ESP, kWordSize)); 1701 __ movsd(XMM0, Address(ESP, kWordSize));
1660 __ DoubleAbs(XMM0); 1702 __ DoubleAbs(XMM0);
1661 __ pushl(EAX); 1703 __ pushl(EAX);
1662 __ pushl(EAX); 1704 __ pushl(EAX);
1663 __ movsd(Address(ESP, 0), XMM0); 1705 __ movsd(Address(ESP, 0), XMM0);
1664 __ fldl(Address(ESP, 0)); 1706 __ fldl(Address(ESP, 0));
1665 __ popl(EAX); 1707 __ popl(EAX);
1666 __ popl(EAX); 1708 __ popl(EAX);
1667 __ ret(); 1709 __ ret();
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 EAX); 1904 EAX);
1863 __ popl(EAX); 1905 __ popl(EAX);
1864 __ popl(CTX); 1906 __ popl(CTX);
1865 __ ret(); 1907 __ ret();
1866 } 1908 }
1867 1909
1868 1910
1869 } // namespace dart 1911 } // namespace dart
1870 1912
1871 #endif // defined TARGET_ARCH_IA32 1913 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698