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 __ |