Index: test/cctest/test-assembler-x64.cc |
diff --git a/test/cctest/test-assembler-x64.cc b/test/cctest/test-assembler-x64.cc |
index 30577751ed4aad226a05f6b8d3f378f6bd186ed5..684f0e1c40011033b53cfca1c83c179fd208a58f 100644 |
--- a/test/cctest/test-assembler-x64.cc |
+++ b/test/cctest/test-assembler-x64.cc |
@@ -77,6 +77,7 @@ using v8::internal::xmm0; |
typedef int (*F0)(); |
typedef int (*F1)(int64_t x); |
typedef int (*F2)(int64_t x, int64_t y); |
+typedef int (*F3)(double x); |
#ifdef _WIN64 |
static const v8::internal::Register arg1 = rcx; |
@@ -517,4 +518,32 @@ TEST(StackAlignmentForSSE2) { |
#endif // __GNUC__ |
+TEST(AssemblerX64Extractps) { |
+ CcTest::InitializeVM(); |
+ if (!v8::internal::CpuFeatures::IsSupported(v8::internal::SSE4_1)) return; |
+ |
+ v8::HandleScope scope(CcTest::isolate()); |
+ v8::internal::byte buffer[256]; |
+ Isolate* isolate = CcTest::i_isolate(); |
+ Assembler assm(isolate, buffer, sizeof(buffer)); |
+ v8::internal::CpuFeatureScope fscope(&assm, v8::internal::SSE4_1); |
+ __ extractps(rax, xmm0, 0x1); |
+ __ ret(0); |
+ |
+ CodeDesc desc; |
+ assm.GetCode(&desc); |
+ Code* code = Code::cast(isolate->heap()->CreateCode( |
+ desc, |
+ Code::ComputeFlags(Code::STUB), |
+ v8::internal::Handle<Code>())->ToObjectChecked()); |
+ CHECK(code->IsCode()); |
+#ifdef OBJECT_PRINT |
+ Code::cast(code)->Print(); |
+#endif |
+ |
+ F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); |
+ CHECK_EQ(0x7FF80000, f(OS::nan_value())); |
+} |
+ |
+ |
#undef __ |