summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-assembler-ia32.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-11-10 02:02:27 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-11-11 02:40:36 +0100
commitf230a1cf749e984439b5bb9729d9db9f48472827 (patch)
tree153596de2251b717ad79823f23fabf4c140d6d35 /deps/v8/test/cctest/test-assembler-ia32.cc
parenta12870c823b9b67110b27a470fcac342cf1dfbd6 (diff)
downloadnode-new-f230a1cf749e984439b5bb9729d9db9f48472827.tar.gz
v8: upgrade to 3.22.24
This commit removes the simple/test-event-emitter-memory-leak test for being unreliable with the new garbage collector: the memory pressure exerted by the test case is too low for the garbage collector to kick in. It can be made to work again by limiting the heap size with the --max_old_space_size=x flag but that won't be very reliable across platforms and architectures.
Diffstat (limited to 'deps/v8/test/cctest/test-assembler-ia32.cc')
-rw-r--r--deps/v8/test/cctest/test-assembler-ia32.cc45
1 files changed, 40 insertions, 5 deletions
diff --git a/deps/v8/test/cctest/test-assembler-ia32.cc b/deps/v8/test/cctest/test-assembler-ia32.cc
index 76eecc02e7..d40156841e 100644
--- a/deps/v8/test/cctest/test-assembler-ia32.cc
+++ b/deps/v8/test/cctest/test-assembler-ia32.cc
@@ -264,15 +264,15 @@ TEST(AssemblerIa326) {
Assembler assm(isolate, buffer, sizeof buffer);
CpuFeatureScope fscope(&assm, SSE2);
- __ movdbl(xmm0, Operand(esp, 1 * kPointerSize));
- __ movdbl(xmm1, Operand(esp, 3 * kPointerSize));
+ __ movsd(xmm0, Operand(esp, 1 * kPointerSize));
+ __ movsd(xmm1, Operand(esp, 3 * kPointerSize));
__ addsd(xmm0, xmm1);
__ mulsd(xmm0, xmm1);
__ subsd(xmm0, xmm1);
__ divsd(xmm0, xmm1);
// Copy xmm0 to st(0) using eight bytes of stack.
__ sub(esp, Immediate(8));
- __ movdbl(Operand(esp, 0), xmm0);
+ __ movsd(Operand(esp, 0), xmm0);
__ fld_d(Operand(esp, 0));
__ add(esp, Immediate(8));
__ ret(0);
@@ -313,7 +313,7 @@ TEST(AssemblerIa328) {
__ cvtsi2sd(xmm0, eax);
// Copy xmm0 to st(0) using eight bytes of stack.
__ sub(esp, Immediate(8));
- __ movdbl(Operand(esp, 0), xmm0);
+ __ movsd(Operand(esp, 0), xmm0);
__ fld_d(Operand(esp, 0));
__ add(esp, Immediate(8));
__ ret(0);
@@ -532,7 +532,7 @@ TEST(StackAlignmentForSSE2) {
CHECK_EQ(0, OS::ActivationFrameAlignment() % 16);
- v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New();
global_template->Set(v8_str("do_sse2"), v8::FunctionTemplate::New(DoSSE2));
@@ -564,4 +564,39 @@ TEST(StackAlignmentForSSE2) {
#endif // __GNUC__
+TEST(AssemblerIa32Extractps) {
+ CcTest::InitializeVM();
+ if (!CpuFeatures::IsSupported(SSE2) ||
+ !CpuFeatures::IsSupported(SSE4_1)) return;
+
+ Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
+ HandleScope scope(isolate);
+ v8::internal::byte buffer[256];
+ MacroAssembler assm(isolate, buffer, sizeof buffer);
+ { CpuFeatureScope fscope2(&assm, SSE2);
+ CpuFeatureScope fscope41(&assm, SSE4_1);
+ __ movsd(xmm1, Operand(esp, 4));
+ __ extractps(eax, xmm1, 0x1);
+ __ 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
+
+ F4 f = FUNCTION_CAST<F4>(Code::cast(code)->entry());
+ uint64_t value1 = V8_2PART_UINT64_C(0x12345678, 87654321);
+ CHECK_EQ(0x12345678, f(uint64_to_double(value1)));
+ uint64_t value2 = V8_2PART_UINT64_C(0x87654321, 12345678);
+ CHECK_EQ(0x87654321, f(uint64_to_double(value2)));
+}
+
+
#undef __