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

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: Created 8 years, 3 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) {
1659 __ movsd(XMM0, Address(ESP, kWordSize));
1660 __ orpd(XMM0, XMM0);
1661 __ pushl(EAX);
1662 __ pushl(EAX);
1663 __ movsd(Address(ESP, 0), XMM0);
1664 __ fldl(Address(ESP, 0));
1665 __ popl(EAX);
1666 __ popl(EAX);
1667 __ ret();
1668 }
1669
1670
1671 ASSEMBLER_TEST_RUN(Orpd, entry) {
1672 typedef double (*OrpdCode)(double d);
1673 double res = reinterpret_cast<OrpdCode>(entry)(12.56e3);
Vyacheslav Egorov (Google) 2012/09/24 14:53:42 Maybe or two different values? e.g. -0.0 and 12.5
Florian Schneider 2012/09/26 11:51:32 Done.
1674 EXPECT_FLOAT_EQ(12.56e3, res, 0.0);
1675 }
1676
1677
1678 ASSEMBLER_TEST_GENERATE(AndPd, assembler) {
1679 __ movsd(XMM0, Address(ESP, kWordSize));
1680 __ andpd(XMM0, XMM0);
1681 __ pushl(EAX);
1682 __ pushl(EAX);
1683 __ movsd(Address(ESP, 0), XMM0);
1684 __ fldl(Address(ESP, 0));
1685 __ popl(EAX);
1686 __ popl(EAX);
1687 __ ret();
1688 }
1689
1690
1691 ASSEMBLER_TEST_RUN(AndPd, entry) {
1692 typedef double (*AndpdCode)(double d);
1693 double res = reinterpret_cast<AndpdCode>(entry)(12.56e3);
1694 EXPECT_FLOAT_EQ(12.56e3, res, 0.0);
1695 }
1696
1697
1658 ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) { 1698 ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) {
1659 __ movsd(XMM0, Address(ESP, kWordSize)); 1699 __ movsd(XMM0, Address(ESP, kWordSize));
1660 __ DoubleAbs(XMM0); 1700 __ DoubleAbs(XMM0);
1661 __ pushl(EAX); 1701 __ pushl(EAX);
1662 __ pushl(EAX); 1702 __ pushl(EAX);
1663 __ movsd(Address(ESP, 0), XMM0); 1703 __ movsd(Address(ESP, 0), XMM0);
1664 __ fldl(Address(ESP, 0)); 1704 __ fldl(Address(ESP, 0));
1665 __ popl(EAX); 1705 __ popl(EAX);
1666 __ popl(EAX); 1706 __ popl(EAX);
1667 __ ret(); 1707 __ ret();
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 EAX); 1902 EAX);
1863 __ popl(EAX); 1903 __ popl(EAX);
1864 __ popl(CTX); 1904 __ popl(CTX);
1865 __ ret(); 1905 __ ret();
1866 } 1906 }
1867 1907
1868 1908
1869 } // namespace dart 1909 } // namespace dart
1870 1910
1871 #endif // defined TARGET_ARCH_IA32 1911 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698