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

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, 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.cc ('k') | runtime/vm/code_generator.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 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 __ 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(Pextrd0, assembler) {
1681 if (CPUFeatures::sse4_1_supported()) {
1682 __ movsd(XMM0, Address(ESP, kWordSize));
1683 __ pextrd(EAX, XMM0, Immediate(0));
1684 __ ret();
1685 }
1686 }
1687
1688
1689 ASSEMBLER_TEST_RUN(Pextrd0, entry) {
1690 if (CPUFeatures::sse4_1_supported()) {
1691 typedef int32_t (*PextrdCode0)(double d);
1692 int32_t res = reinterpret_cast<PextrdCode0>(entry)(123456789);
1693 EXPECT_EQ(0x54000000, res);
1694 }
1695 }
1696
1697
1698 ASSEMBLER_TEST_GENERATE(Pextrd1, assembler) {
1699 if (CPUFeatures::sse4_1_supported()) {
1700 __ movsd(XMM0, Address(ESP, kWordSize));
1701 __ pextrd(EAX, XMM0, Immediate(1));
1702 __ ret();
1703 }
1704 }
1705
1706
1707 ASSEMBLER_TEST_RUN(Pextrd1, entry) {
1708 if (CPUFeatures::sse4_1_supported()) {
1709 typedef int32_t (*PextrdCode1)(double d);
1710 int32_t res = reinterpret_cast<PextrdCode1>(entry)(123456789);
1711 EXPECT_EQ(0x419d6f34, res);
1712 }
1713 }
1714
1715
1716 ASSEMBLER_TEST_GENERATE(Pmovsxdq, assembler) {
1717 if (CPUFeatures::sse4_1_supported()) {
1718 __ movsd(XMM0, Address(ESP, kWordSize));
1719 __ pmovsxdq(XMM0, XMM0);
1720 __ pextrd(EAX, XMM0, Immediate(1));
1721 __ ret();
1722 }
1723 }
1724
1725
1726 ASSEMBLER_TEST_RUN(Pmovsxdq, entry) {
1727 if (CPUFeatures::sse4_1_supported()) {
1728 typedef int32_t (*PmovsxdqCode)(double d);
1729 int32_t res = reinterpret_cast<PmovsxdqCode>(entry)(123456789);
1730 EXPECT_EQ(0, res);
1731 }
1732 }
1733
1734
1735 ASSEMBLER_TEST_GENERATE(Pcmpeqq, assembler) {
1736 if (CPUFeatures::sse4_1_supported()) {
1737 __ movsd(XMM0, Address(ESP, kWordSize));
1738 __ xorpd(XMM1, XMM1);
1739 __ pcmpeqq(XMM0, XMM1);
1740 __ movd(EAX, XMM0);
1741 __ ret();
1742 }
1743 }
1744
1745
1746 ASSEMBLER_TEST_RUN(Pcmpeqq, entry) {
1747 if (CPUFeatures::sse4_1_supported()) {
1748 typedef int32_t (*PcmpeqqCode)(double d);
1749 int32_t res = reinterpret_cast<PcmpeqqCode>(entry)(0);
1750 EXPECT_EQ(-1, res);
1751 }
1752 }
1753
1754
1755 ASSEMBLER_TEST_GENERATE(AndPd, assembler) {
1756 __ movsd(XMM0, Address(ESP, kWordSize));
1757 __ andpd(XMM0, XMM0);
1758 __ pushl(EAX);
1759 __ pushl(EAX);
1760 __ movsd(Address(ESP, 0), XMM0);
1761 __ fldl(Address(ESP, 0));
1762 __ popl(EAX);
1763 __ popl(EAX);
1764 __ ret();
1765 }
1766
1767
1768 ASSEMBLER_TEST_RUN(AndPd, entry) {
1769 typedef double (*AndpdCode)(double d);
1770 double res = reinterpret_cast<AndpdCode>(entry)(12.56e3);
1771 EXPECT_FLOAT_EQ(12.56e3, res, 0.0);
1772 }
1773
1774
1658 ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) { 1775 ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) {
1659 __ movsd(XMM0, Address(ESP, kWordSize)); 1776 __ movsd(XMM0, Address(ESP, kWordSize));
1660 __ DoubleAbs(XMM0); 1777 __ DoubleAbs(XMM0);
1661 __ pushl(EAX); 1778 __ pushl(EAX);
1662 __ pushl(EAX); 1779 __ pushl(EAX);
1663 __ movsd(Address(ESP, 0), XMM0); 1780 __ movsd(Address(ESP, 0), XMM0);
1664 __ fldl(Address(ESP, 0)); 1781 __ fldl(Address(ESP, 0));
1665 __ popl(EAX); 1782 __ popl(EAX);
1666 __ popl(EAX); 1783 __ popl(EAX);
1667 __ ret(); 1784 __ ret();
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 EAX); 1979 EAX);
1863 __ popl(EAX); 1980 __ popl(EAX);
1864 __ popl(CTX); 1981 __ popl(CTX);
1865 __ ret(); 1982 __ ret();
1866 } 1983 }
1867 1984
1868 1985
1869 } // namespace dart 1986 } // namespace dart
1870 1987
1871 #endif // defined TARGET_ARCH_IA32 1988 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/code_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698