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

Unified Diff: runtime/vm/assembler_x64_test.cc

Issue 1499763002: Reapply "Precompilation/x64: Load float vector constants via Thread." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64_test.cc
diff --git a/runtime/vm/assembler_x64_test.cc b/runtime/vm/assembler_x64_test.cc
index a78f3ca6c3030b812bfed4ff71740f5378d69c38..eb8219d9d982186e4f4ae7c7c1c2462ec7afd4fb 100644
--- a/runtime/vm/assembler_x64_test.cc
+++ b/runtime/vm/assembler_x64_test.cc
@@ -2021,16 +2021,21 @@ ASSEMBLER_TEST_RUN(PackedDoubleSub, test) {
static void EnterTestFrame(Assembler* assembler) {
+ COMPILE_ASSERT(THR != CallingConventions::kArg1Reg);
+ COMPILE_ASSERT(CODE_REG != CallingConventions::kArg2Reg);
__ EnterFrame(0);
__ pushq(CODE_REG);
__ pushq(PP);
+ __ pushq(THR);
__ movq(CODE_REG, Address(CallingConventions::kArg1Reg,
VMHandles::kOffsetOfRawPtrInHandle));
+ __ movq(THR, CallingConventions::kArg2Reg);
__ LoadPoolPointer(PP);
}
static void LeaveTestFrame(Assembler* assembler) {
+ __ popq(THR);
__ popq(PP);
__ popq(CODE_REG);
__ LeaveFrame();
@@ -2053,7 +2058,7 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleNegate, assembler) {
ASSEMBLER_TEST_RUN(PackedDoubleNegate, test) {
- double res = test->InvokeWithCode<double>();
+ double res = test->InvokeWithCodeAndThread<double>();
EXPECT_FLOAT_EQ(-1.0, res, 0.000001f);
}
@@ -2074,7 +2079,7 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleAbsolute, assembler) {
ASSEMBLER_TEST_RUN(PackedDoubleAbsolute, test) {
- double res = test->InvokeWithCode<double>();
+ double res = test->InvokeWithCodeAndThread<double>();
EXPECT_FLOAT_EQ(1.0, res, 0.000001f);
}
@@ -2520,7 +2525,7 @@ ASSEMBLER_TEST_GENERATE(PackedNegate, assembler) {
ASSEMBLER_TEST_RUN(PackedNegate, test) {
- float res = test->InvokeWithCode<float>();
+ float res = test->InvokeWithCodeAndThread<float>();
EXPECT_FLOAT_EQ(-12.3f, res, 0.001f);
}
@@ -2538,7 +2543,7 @@ ASSEMBLER_TEST_GENERATE(PackedAbsolute, assembler) {
ASSEMBLER_TEST_RUN(PackedAbsolute, test) {
- float res = test->InvokeWithCode<float>();
+ float res = test->InvokeWithCodeAndThread<float>();
EXPECT_FLOAT_EQ(15.3f, res, 0.001f);
}
@@ -2554,7 +2559,7 @@ ASSEMBLER_TEST_GENERATE(PackedSetWZero, assembler) {
ASSEMBLER_TEST_RUN(PackedSetWZero, test) {
- float res = test->InvokeWithCode<float>();
+ float res = test->InvokeWithCodeAndThread<float>();
EXPECT_FLOAT_EQ(0.0f, res, 0.001f);
}
@@ -2678,7 +2683,7 @@ ASSEMBLER_TEST_GENERATE(PackedLogicalNot, assembler) {
ASSEMBLER_TEST_RUN(PackedLogicalNot, test) {
- uint32_t res = test->InvokeWithCode<uint32_t>();
+ uint32_t res = test->InvokeWithCodeAndThread<uint32_t>();
EXPECT_EQ(static_cast<uword>(0x0), res);
}
@@ -3092,8 +3097,7 @@ ASSEMBLER_TEST_GENERATE(TestObjectCompare, assembler) {
__ CompareObject(RCX, smi);
__ j(NOT_EQUAL, &fail);
__ movl(RAX, Immediate(1)); // OK
- __ popq(PP); // Restore caller's pool pointer.
- __ LeaveFrame();
+ LeaveTestFrame(assembler);
__ ret();
__ Bind(&fail);
__ movl(RAX, Immediate(0)); // Fail.
@@ -3103,7 +3107,7 @@ ASSEMBLER_TEST_GENERATE(TestObjectCompare, assembler) {
ASSEMBLER_TEST_RUN(TestObjectCompare, test) {
- bool res = test->InvokeWithCode<bool>();
+ bool res = test->InvokeWithCodeAndThread<bool>();
EXPECT_EQ(true, res);
}
@@ -3415,10 +3419,13 @@ ASSEMBLER_TEST_RUN(DoubleToDoubleTrunc, test) {
ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) {
EnterTestFrame(assembler);
#if defined(TARGET_OS_WINDOWS)
- // First argument is code object, MSVC passes second argument in XMM1.
- __ DoubleAbs(XMM1);
- __ movaps(XMM0, XMM1);
+ // First argument is code object, second argument is thread. MSVC passes
+ // third argument in XMM2.
+ __ DoubleAbs(XMM2);
+ __ movaps(XMM0, XMM2);
#else
+ // SysV ABI allocates integral and double registers for arguments
+ // independently.
__ DoubleAbs(XMM0);
#endif
LeaveTestFrame(assembler);
@@ -3428,10 +3435,10 @@ ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) {
ASSEMBLER_TEST_RUN(DoubleAbs, test) {
double val = -12.45;
- double res = test->InvokeWithCode<double, double>(val);
+ double res = test->InvokeWithCodeAndThread<double, double>(val);
EXPECT_FLOAT_EQ(-val, res, 0.001);
val = 12.45;
- res = test->InvokeWithCode<double, double>(val);
+ res = test->InvokeWithCodeAndThread<double, double>(val);
EXPECT_FLOAT_EQ(val, res, 0.001);
}
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698