Index: test/cctest/test-assembler-x64.cc |
diff --git a/test/cctest/test-assembler-x64.cc b/test/cctest/test-assembler-x64.cc |
index cd1ed2823bbd10544e6da257566ed4184cd64ce2..4372d8a3ecff8392e5e64a8bcd31211ec092feaf 100644 |
--- a/test/cctest/test-assembler-x64.cc |
+++ b/test/cctest/test-assembler-x64.cc |
@@ -676,4 +676,38 @@ TEST(AssemblerX64Extractps) { |
} |
+typedef int (*F6)(float x, float y); |
+TEST(AssemblerX64SSE) { |
+ CcTest::InitializeVM(); |
+ |
+ Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate()); |
+ HandleScope scope(isolate); |
+ v8::internal::byte buffer[256]; |
+ MacroAssembler assm(isolate, buffer, sizeof buffer); |
+ { |
+ __ shufps(xmm0, xmm0, 0x0); // brocast first argument |
+ __ shufps(xmm1, xmm1, 0x0); // brocast second argument |
+ __ movaps(xmm2, xmm1); |
+ __ addps(xmm2, xmm0); |
+ __ mulps(xmm2, xmm1); |
+ __ subps(xmm2, xmm0); |
+ __ divps(xmm2, xmm1); |
+ __ cvttss2si(rax, xmm2); |
+ __ ret(0); |
+ } |
+ |
+ CodeDesc desc; |
+ assm.GetCode(&desc); |
+ Code* code = Code::cast(isolate->heap()->CreateCode( |
+ desc, |
+ Code::ComputeFlags(Code::STUB), |
+ Handle<Code>())->ToObjectChecked()); |
+ CHECK(code->IsCode()); |
+#ifdef OBJECT_PRINT |
+ Code::cast(code)->Print(); |
+#endif |
+ |
+ F6 f = FUNCTION_CAST<F6>(Code::cast(code)->entry()); |
+ CHECK_EQ(2, f(1.0, 2.0)); |
+} |
#undef __ |