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

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

Issue 63993003: Fix build break on the bots. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | « no previous file | no next file » | 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_X64) 6 #if defined(TARGET_ARCH_X64)
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 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1618 1618
1619 1619
1620 ASSEMBLER_TEST_RUN(PackedCompareNLE, test) { 1620 ASSEMBLER_TEST_RUN(PackedCompareNLE, test) {
1621 typedef uint32_t (*PackedCompareNLECode)(); 1621 typedef uint32_t (*PackedCompareNLECode)();
1622 uint32_t res = reinterpret_cast<PackedCompareNLECode>(test->entry())(); 1622 uint32_t res = reinterpret_cast<PackedCompareNLECode>(test->entry())();
1623 EXPECT_EQ(static_cast<uword>(0x0), res); 1623 EXPECT_EQ(static_cast<uword>(0x0), res);
1624 } 1624 }
1625 1625
1626 1626
1627 ASSEMBLER_TEST_GENERATE(PackedNegate, assembler) { 1627 ASSEMBLER_TEST_GENERATE(PackedNegate, assembler) {
1628 __ pushq(PP); // Save caller's pool pointer and load a new one here.
1629 __ LoadPoolPointer(PP);
1628 __ movl(RAX, Immediate(bit_cast<int32_t, float>(12.3f))); 1630 __ movl(RAX, Immediate(bit_cast<int32_t, float>(12.3f)));
1629 __ movd(XMM0, RAX); 1631 __ movd(XMM0, RAX);
1630 __ shufps(XMM0, XMM0, Immediate(0x0)); 1632 __ shufps(XMM0, XMM0, Immediate(0x0));
1631 __ negateps(XMM0); 1633 __ negateps(XMM0);
1632 __ shufps(XMM0, XMM0, Immediate(0xAA)); // Copy third lane into all 4 lanes. 1634 __ shufps(XMM0, XMM0, Immediate(0xAA)); // Copy third lane into all 4 lanes.
1635 __ popq(PP); // Restore caller's pool pointer.
1633 __ ret(); 1636 __ ret();
1634 } 1637 }
1635 1638
1636 1639
1637 ASSEMBLER_TEST_RUN(PackedNegate, test) { 1640 ASSEMBLER_TEST_RUN(PackedNegate, test) {
1638 typedef float (*PackedNegateCode)(); 1641 typedef float (*PackedNegateCode)();
1639 float res = reinterpret_cast<PackedNegateCode>(test->entry())(); 1642 float res = reinterpret_cast<PackedNegateCode>(test->entry())();
1640 EXPECT_FLOAT_EQ(-12.3f, res, 0.001f); 1643 EXPECT_FLOAT_EQ(-12.3f, res, 0.001f);
1641 } 1644 }
1642 1645
1643 1646
1644 ASSEMBLER_TEST_GENERATE(PackedAbsolute, assembler) { 1647 ASSEMBLER_TEST_GENERATE(PackedAbsolute, assembler) {
1648 __ pushq(PP); // Save caller's pool pointer and load a new one here.
1649 __ LoadPoolPointer(PP);
1645 __ movl(RAX, Immediate(bit_cast<int32_t, float>(-15.3f))); 1650 __ movl(RAX, Immediate(bit_cast<int32_t, float>(-15.3f)));
1646 __ movd(XMM0, RAX); 1651 __ movd(XMM0, RAX);
1647 __ shufps(XMM0, XMM0, Immediate(0x0)); 1652 __ shufps(XMM0, XMM0, Immediate(0x0));
1648 __ absps(XMM0); 1653 __ absps(XMM0);
1649 __ shufps(XMM0, XMM0, Immediate(0xAA)); // Copy third lane into all 4 lanes. 1654 __ shufps(XMM0, XMM0, Immediate(0xAA)); // Copy third lane into all 4 lanes.
1655 __ popq(PP); // Restore caller's pool pointer.
1650 __ ret(); 1656 __ ret();
1651 } 1657 }
1652 1658
1653 1659
1654 ASSEMBLER_TEST_RUN(PackedAbsolute, test) { 1660 ASSEMBLER_TEST_RUN(PackedAbsolute, test) {
1655 typedef float (*PackedAbsoluteCode)(); 1661 typedef float (*PackedAbsoluteCode)();
1656 float res = reinterpret_cast<PackedAbsoluteCode>(test->entry())(); 1662 float res = reinterpret_cast<PackedAbsoluteCode>(test->entry())();
1657 EXPECT_FLOAT_EQ(15.3f, res, 0.001f); 1663 EXPECT_FLOAT_EQ(15.3f, res, 0.001f);
1658 } 1664 }
1659 1665
1660 1666
1661 ASSEMBLER_TEST_GENERATE(PackedSetWZero, assembler) { 1667 ASSEMBLER_TEST_GENERATE(PackedSetWZero, assembler) {
1668 __ pushq(PP); // Save caller's pool pointer and load a new one here.
1669 __ LoadPoolPointer(PP);
1662 __ set1ps(XMM0, RAX, Immediate(bit_cast<int32_t, float>(12.3f))); 1670 __ set1ps(XMM0, RAX, Immediate(bit_cast<int32_t, float>(12.3f)));
1663 __ zerowps(XMM0); 1671 __ zerowps(XMM0);
1664 __ shufps(XMM0, XMM0, Immediate(0xFF)); // Copy the W lane which is now 0.0. 1672 __ shufps(XMM0, XMM0, Immediate(0xFF)); // Copy the W lane which is now 0.0.
1673 __ popq(PP); // Restore caller's pool pointer.
1665 __ ret(); 1674 __ ret();
1666 } 1675 }
1667 1676
1668 1677
1669 ASSEMBLER_TEST_RUN(PackedSetWZero, test) { 1678 ASSEMBLER_TEST_RUN(PackedSetWZero, test) {
1670 typedef float (*PackedSetWZeroCode)(); 1679 typedef float (*PackedSetWZeroCode)();
1671 float res = reinterpret_cast<PackedSetWZeroCode>(test->entry())(); 1680 float res = reinterpret_cast<PackedSetWZeroCode>(test->entry())();
1672 EXPECT_FLOAT_EQ(0.0f, res, 0.001f); 1681 EXPECT_FLOAT_EQ(0.0f, res, 0.001f);
1673 } 1682 }
1674 1683
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
2201 __ StoreObject(Address(RSP, 0), obj, PP); 2210 __ StoreObject(Address(RSP, 0), obj, PP);
2202 __ popq(RCX); 2211 __ popq(RCX);
2203 __ CompareObject(RCX, obj, PP); 2212 __ CompareObject(RCX, obj, PP);
2204 __ j(NOT_EQUAL, &fail); 2213 __ j(NOT_EQUAL, &fail);
2205 __ pushq(RAX); 2214 __ pushq(RAX);
2206 __ StoreObject(Address(RSP, 0), smi, PP); 2215 __ StoreObject(Address(RSP, 0), smi, PP);
2207 __ popq(RCX); 2216 __ popq(RCX);
2208 __ CompareObject(RCX, smi, PP); 2217 __ CompareObject(RCX, smi, PP);
2209 __ j(NOT_EQUAL, &fail); 2218 __ j(NOT_EQUAL, &fail);
2210 __ movl(RAX, Immediate(1)); // OK 2219 __ movl(RAX, Immediate(1)); // OK
2211 __ LeaveDartFrame(); 2220 __ LeaveFrame();
2212 __ ret(); 2221 __ ret();
2213 __ Bind(&fail); 2222 __ Bind(&fail);
2214 __ movl(RAX, Immediate(0)); // Fail. 2223 __ movl(RAX, Immediate(0)); // Fail.
2215 __ popq(PP); // Restore caller's pool pointer. 2224 __ popq(PP); // Restore caller's pool pointer.
2216 __ LeaveFrame(); 2225 __ LeaveFrame();
2217 __ ret(); 2226 __ ret();
2218 } 2227 }
2219 2228
2220 2229
2221 ASSEMBLER_TEST_RUN(TestObjectCompare, test) { 2230 ASSEMBLER_TEST_RUN(TestObjectCompare, test) {
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
2539 res = reinterpret_cast<DoubleToDoubleTruncCode>(test->entry())(12.8); 2548 res = reinterpret_cast<DoubleToDoubleTruncCode>(test->entry())(12.8);
2540 EXPECT_EQ(12.0, res); 2549 EXPECT_EQ(12.0, res);
2541 res = reinterpret_cast<DoubleToDoubleTruncCode>(test->entry())(-12.3); 2550 res = reinterpret_cast<DoubleToDoubleTruncCode>(test->entry())(-12.3);
2542 EXPECT_EQ(-12.0, res); 2551 EXPECT_EQ(-12.0, res);
2543 res = reinterpret_cast<DoubleToDoubleTruncCode>(test->entry())(-12.8); 2552 res = reinterpret_cast<DoubleToDoubleTruncCode>(test->entry())(-12.8);
2544 EXPECT_EQ(-12.0, res); 2553 EXPECT_EQ(-12.0, res);
2545 } 2554 }
2546 2555
2547 2556
2548 ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) { 2557 ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) {
2558 __ pushq(PP); // Save caller's pool pointer and load a new one here.
2559 __ LoadPoolPointer(PP);
2549 __ DoubleAbs(XMM0); 2560 __ DoubleAbs(XMM0);
2561 __ popq(PP); // Restore caller's pool pointer.
2550 __ ret(); 2562 __ ret();
2551 } 2563 }
2552 2564
2553 2565
2554 ASSEMBLER_TEST_RUN(DoubleAbs, test) { 2566 ASSEMBLER_TEST_RUN(DoubleAbs, test) {
2555 typedef double (*DoubleAbsCode)(double d); 2567 typedef double (*DoubleAbsCode)(double d);
2556 double val = -12.45; 2568 double val = -12.45;
2557 double res = reinterpret_cast<DoubleAbsCode>(test->entry())(val); 2569 double res = reinterpret_cast<DoubleAbsCode>(test->entry())(val);
2558 EXPECT_FLOAT_EQ(-val, res, 0.001); 2570 EXPECT_FLOAT_EQ(-val, res, 0.001);
2559 val = 12.45; 2571 val = 12.45;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
2643 EXPECT_EQ(1, res); // Greater equal. 2655 EXPECT_EQ(1, res); // Greater equal.
2644 res = reinterpret_cast<ConditionalMovesCompareCode>(test->entry())(5, 5); 2656 res = reinterpret_cast<ConditionalMovesCompareCode>(test->entry())(5, 5);
2645 EXPECT_EQ(1, res); // Greater equal. 2657 EXPECT_EQ(1, res); // Greater equal.
2646 res = reinterpret_cast<ConditionalMovesCompareCode>(test->entry())(2, 5); 2658 res = reinterpret_cast<ConditionalMovesCompareCode>(test->entry())(2, 5);
2647 EXPECT_EQ(-1, res); // Less. 2659 EXPECT_EQ(-1, res); // Less.
2648 } 2660 }
2649 2661
2650 } // namespace dart 2662 } // namespace dart
2651 2663
2652 #endif // defined TARGET_ARCH_X64 2664 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698