Revision f230a1cf deps/v8/test/cctest/test-assembler-ia32.cc

View differences:

deps/v8/test/cctest/test-assembler-ia32.cc
264 264
  Assembler assm(isolate, buffer, sizeof buffer);
265 265

  
266 266
  CpuFeatureScope fscope(&assm, SSE2);
267
  __ movdbl(xmm0, Operand(esp, 1 * kPointerSize));
268
  __ movdbl(xmm1, Operand(esp, 3 * kPointerSize));
267
  __ movsd(xmm0, Operand(esp, 1 * kPointerSize));
268
  __ movsd(xmm1, Operand(esp, 3 * kPointerSize));
269 269
  __ addsd(xmm0, xmm1);
270 270
  __ mulsd(xmm0, xmm1);
271 271
  __ subsd(xmm0, xmm1);
272 272
  __ divsd(xmm0, xmm1);
273 273
  // Copy xmm0 to st(0) using eight bytes of stack.
274 274
  __ sub(esp, Immediate(8));
275
  __ movdbl(Operand(esp, 0), xmm0);
275
  __ movsd(Operand(esp, 0), xmm0);
276 276
  __ fld_d(Operand(esp, 0));
277 277
  __ add(esp, Immediate(8));
278 278
  __ ret(0);
......
313 313
  __ cvtsi2sd(xmm0, eax);
314 314
  // Copy xmm0 to st(0) using eight bytes of stack.
315 315
  __ sub(esp, Immediate(8));
316
  __ movdbl(Operand(esp, 0), xmm0);
316
  __ movsd(Operand(esp, 0), xmm0);
317 317
  __ fld_d(Operand(esp, 0));
318 318
  __ add(esp, Immediate(8));
319 319
  __ ret(0);
......
532 532

  
533 533
  CHECK_EQ(0, OS::ActivationFrameAlignment() % 16);
534 534

  
535
  v8::Isolate* isolate = v8::Isolate::GetCurrent();
535
  v8::Isolate* isolate = CcTest::isolate();
536 536
  v8::HandleScope handle_scope(isolate);
537 537
  v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New();
538 538
  global_template->Set(v8_str("do_sse2"), v8::FunctionTemplate::New(DoSSE2));
......
564 564
#endif  // __GNUC__
565 565

  
566 566

  
567
TEST(AssemblerIa32Extractps) {
568
  CcTest::InitializeVM();
569
  if (!CpuFeatures::IsSupported(SSE2) ||
570
      !CpuFeatures::IsSupported(SSE4_1)) return;
571

  
572
  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
573
  HandleScope scope(isolate);
574
  v8::internal::byte buffer[256];
575
  MacroAssembler assm(isolate, buffer, sizeof buffer);
576
  { CpuFeatureScope fscope2(&assm, SSE2);
577
    CpuFeatureScope fscope41(&assm, SSE4_1);
578
    __ movsd(xmm1, Operand(esp, 4));
579
    __ extractps(eax, xmm1, 0x1);
580
    __ ret(0);
581
  }
582

  
583
  CodeDesc desc;
584
  assm.GetCode(&desc);
585
  Code* code = Code::cast(isolate->heap()->CreateCode(
586
      desc,
587
      Code::ComputeFlags(Code::STUB),
588
      Handle<Code>())->ToObjectChecked());
589
  CHECK(code->IsCode());
590
#ifdef OBJECT_PRINT
591
  Code::cast(code)->Print();
592
#endif
593

  
594
  F4 f = FUNCTION_CAST<F4>(Code::cast(code)->entry());
595
  uint64_t value1 = V8_2PART_UINT64_C(0x12345678, 87654321);
596
  CHECK_EQ(0x12345678, f(uint64_to_double(value1)));
597
  uint64_t value2 = V8_2PART_UINT64_C(0x87654321, 12345678);
598
  CHECK_EQ(0x87654321, f(uint64_to_double(value2)));
599
}
600

  
601

  
567 602
#undef __

Also available in: Unified diff