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

Unified Diff: test/cctest/test-assembler-x64.cc

Issue 2158923002: [x64] fixed "vmovups reg, mem" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-assembler-x64.cc
diff --git a/test/cctest/test-assembler-x64.cc b/test/cctest/test-assembler-x64.cc
index 00d36097d08efc3a6aabd19f96c3f09e341ef896..36f1b30df9a40711cd97a57d5dc48637b8ff61fb 100644
--- a/test/cctest/test-assembler-x64.cc
+++ b/test/cctest/test-assembler-x64.cc
@@ -2316,4 +2316,40 @@ TEST(AssemblerX64PslldWithXmm15) {
CHECK_EQ(V8_UINT64_C(0x22446688aaccef10), result);
}
+typedef float (*F9)(float x, float y);
+TEST(AssemblerX64vmovups) {
+ CcTest::InitializeVM();
+ if (!CpuFeatures::IsSupported(AVX)) return;
+
+ Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
+ HandleScope scope(isolate);
+ v8::internal::byte buffer[256];
+ MacroAssembler assm(isolate, buffer, sizeof(buffer),
+ v8::internal::CodeObjectRequired::kYes);
+ {
+ CpuFeatureScope avx_scope(&assm, AVX);
+ __ shufps(xmm0, xmm0, 0x0); // brocast first argument
+ __ shufps(xmm1, xmm1, 0x0); // brocast second argument
+ // copy xmm1 to xmm0 through the stack to test the "vmovups reg, mem".
+ __ subq(rsp, Immediate(kSimd128Size));
+ __ vmovups(Operand(rsp, 0), xmm1);
+ __ vmovups(xmm0, Operand(rsp, 0));
+ __ addq(rsp, Immediate(kSimd128Size));
+
+ __ ret(0);
+ }
+
+ CodeDesc desc;
+ assm.GetCode(&desc);
+ Handle<Code> code = isolate->factory()->NewCode(
+ desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
+#ifdef OBJECT_PRINT
+ OFStream os(stdout);
+ code->Print(os);
+#endif
+
+ F9 f = FUNCTION_CAST<F9>(code->entry());
+ CHECK_EQ(-1.5, f(1.5, -1.5));
+}
+
#undef __
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698