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

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

Issue 27097002: Fixed bug in extractps instruction on ia32 and x64 (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Fixed failure in debug mode test Created 7 years, 2 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 | « test/cctest/test-assembler-ia32.cc ('k') | test/cctest/test-disasm-ia32.cc » ('j') | 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 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 __
« no previous file with comments | « test/cctest/test-assembler-ia32.cc ('k') | test/cctest/test-disasm-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698