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

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

Issue 11043020: Add fast 64-bit bitwise negation to the IA32 optimizing compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed bug in the optimizer that prevented optimization 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 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 } 1714 }
1715 1715
1716 1716
1717 ASSEMBLER_TEST_RUN(XorpdZeroing, entry) { 1717 ASSEMBLER_TEST_RUN(XorpdZeroing, entry) {
1718 typedef double (*XorpdZeroingCode)(double d); 1718 typedef double (*XorpdZeroingCode)(double d);
1719 double res = reinterpret_cast<XorpdZeroingCode>(entry)(12.56e3); 1719 double res = reinterpret_cast<XorpdZeroingCode>(entry)(12.56e3);
1720 EXPECT_FLOAT_EQ(0.0, res, 0.0001); 1720 EXPECT_FLOAT_EQ(0.0, res, 0.0001);
1721 } 1721 }
1722 1722
1723 1723
1724 ASSEMBLER_TEST_GENERATE(Pxor, assembler) {
1725 __ movsd(XMM0, Address(ESP, kWordSize));
1726 __ pxor(XMM0, XMM0);
1727 __ pushl(EAX);
1728 __ pushl(EAX);
1729 __ movsd(Address(ESP, 0), XMM0);
1730 __ fldl(Address(ESP, 0));
1731 __ popl(EAX);
1732 __ popl(EAX);
1733 __ ret();
1734 }
1735
1736
1737 ASSEMBLER_TEST_RUN(Pxor, entry) {
1738 typedef double (*PxorCode)(double d);
1739 double res = reinterpret_cast<PxorCode>(entry)(12.3456e3);
1740 EXPECT_FLOAT_EQ(0.0, res, 0.0);
1741 }
1742
1743
1724 ASSEMBLER_TEST_GENERATE(Orpd, assembler) { 1744 ASSEMBLER_TEST_GENERATE(Orpd, assembler) {
1725 __ movsd(XMM0, Address(ESP, kWordSize)); 1745 __ movsd(XMM0, Address(ESP, kWordSize));
1726 __ xorpd(XMM1, XMM1); 1746 __ xorpd(XMM1, XMM1);
1727 __ DoubleNegate(XMM1); 1747 __ DoubleNegate(XMM1);
1728 __ orpd(XMM0, XMM1); 1748 __ orpd(XMM0, XMM1);
1729 __ pushl(EAX); 1749 __ pushl(EAX);
1730 __ pushl(EAX); 1750 __ pushl(EAX);
1731 __ movsd(Address(ESP, 0), XMM0); 1751 __ movsd(Address(ESP, 0), XMM0);
1732 __ fldl(Address(ESP, 0)); 1752 __ fldl(Address(ESP, 0));
1733 __ popl(EAX); 1753 __ popl(EAX);
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 EAX); 2083 EAX);
2064 __ popl(EAX); 2084 __ popl(EAX);
2065 __ popl(CTX); 2085 __ popl(CTX);
2066 __ ret(); 2086 __ ret();
2067 } 2087 }
2068 2088
2069 2089
2070 } // namespace dart 2090 } // namespace dart
2071 2091
2072 #endif // defined TARGET_ARCH_IA32 2092 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698