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

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

Issue 183923026: Inline of Float64x2 operations round 1 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/assembler_x64.h » ('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/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/os.h" 10 #include "vm/os.h"
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 } 1739 }
1740 1740
1741 1741
1742 ASSEMBLER_TEST_RUN(PackedDoubleMax, test) { 1742 ASSEMBLER_TEST_RUN(PackedDoubleMax, test) {
1743 typedef double (*PackedDoubleMax)(); 1743 typedef double (*PackedDoubleMax)();
1744 double res = reinterpret_cast<PackedDoubleMax>(test->entry())(); 1744 double res = reinterpret_cast<PackedDoubleMax>(test->entry())();
1745 EXPECT_FLOAT_EQ(9.0, res, 0.000001f); 1745 EXPECT_FLOAT_EQ(9.0, res, 0.000001f);
1746 } 1746 }
1747 1747
1748 1748
1749 ASSEMBLER_TEST_GENERATE(PackedDoubleShuffle, assembler) {
1750 static const struct ALIGN16 {
1751 double a;
1752 double b;
1753 } constant0 = { 2.0, 9.0 };
1754 __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
1755 // Splat Y across all lanes.
1756 __ shufpd(XMM0, XMM0, Immediate(0x33));
1757 // Splat X across all lanes.
1758 __ shufpd(XMM0, XMM0, Immediate(0x0));
1759 // Set return value.
1760 __ pushl(EAX);
1761 __ pushl(EAX);
1762 __ movsd(Address(ESP, 0), XMM0);
1763 __ fldl(Address(ESP, 0));
1764 __ popl(EAX);
1765 __ popl(EAX);
1766 __ ret();
1767 }
1768
1769
1770 ASSEMBLER_TEST_RUN(PackedDoubleShuffle, test) {
1771 typedef double (*PackedDoubleShuffle)();
1772 double res = reinterpret_cast<PackedDoubleShuffle>(test->entry())();
1773 EXPECT_FLOAT_EQ(9.0, res, 0.000001f);
1774 }
1775
1776
1749 ASSEMBLER_TEST_GENERATE(PackedDoubleToSingle, assembler) { 1777 ASSEMBLER_TEST_GENERATE(PackedDoubleToSingle, assembler) {
1750 static const struct ALIGN16 { 1778 static const struct ALIGN16 {
1751 double a; 1779 double a;
1752 double b; 1780 double b;
1753 } constant0 = { 9.0, 2.0 }; 1781 } constant0 = { 9.0, 2.0 };
1754 __ movups(XMM1, Address::Absolute(reinterpret_cast<uword>(&constant0))); 1782 __ movups(XMM1, Address::Absolute(reinterpret_cast<uword>(&constant0)));
1755 __ cvtpd2ps(XMM0, XMM1); 1783 __ cvtpd2ps(XMM0, XMM1);
1756 __ pushl(EAX); 1784 __ pushl(EAX);
1757 __ movss(Address(ESP, 0), XMM0); 1785 __ movss(Address(ESP, 0), XMM0);
1758 __ flds(Address(ESP, 0)); 1786 __ flds(Address(ESP, 0));
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
3193 FieldAddress(ECX, GrowableObjectArray::data_offset()), 3221 FieldAddress(ECX, GrowableObjectArray::data_offset()),
3194 EAX); 3222 EAX);
3195 __ popl(EAX); 3223 __ popl(EAX);
3196 __ popl(CTX); 3224 __ popl(CTX);
3197 __ ret(); 3225 __ ret();
3198 } 3226 }
3199 3227
3200 } // namespace dart 3228 } // namespace dart
3201 3229
3202 #endif // defined TARGET_ARCH_IA32 3230 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698