OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 v8::Local<v8::Value> result = foo->Call(global_object, 1, args); | 557 v8::Local<v8::Value> result = foo->Call(global_object, 1, args); |
558 | 558 |
559 // The mask should be 0b1000. | 559 // The mask should be 0b1000. |
560 CHECK_EQ(8, result->Int32Value()); | 560 CHECK_EQ(8, result->Int32Value()); |
561 } | 561 } |
562 | 562 |
563 #undef ELEMENT_COUNT | 563 #undef ELEMENT_COUNT |
564 #endif // __GNUC__ | 564 #endif // __GNUC__ |
565 | 565 |
566 | 566 |
| 567 TEST(AssemblerIa32Extractps) { |
| 568 CcTest::InitializeVM(); |
| 569 if (!CpuFeatures::IsSupported(SSE4_1)) return; |
| 570 |
| 571 Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate()); |
| 572 HandleScope scope(isolate); |
| 573 v8::internal::byte buffer[256]; |
| 574 MacroAssembler assm(isolate, buffer, sizeof buffer); |
| 575 { CpuFeatureScope fscope2(&assm, SSE2); |
| 576 CpuFeatureScope fscope41(&assm, SSE4_1); |
| 577 __ movdbl(xmm1, Operand(esp, 4)); |
| 578 __ extractps(eax, xmm1, 0x1); |
| 579 __ ret(0); |
| 580 } |
| 581 |
| 582 CodeDesc desc; |
| 583 assm.GetCode(&desc); |
| 584 Code* code = Code::cast(isolate->heap()->CreateCode( |
| 585 desc, |
| 586 Code::ComputeFlags(Code::STUB), |
| 587 Handle<Code>())->ToObjectChecked()); |
| 588 CHECK(code->IsCode()); |
| 589 #ifdef OBJECT_PRINT |
| 590 Code::cast(code)->Print(); |
| 591 #endif |
| 592 |
| 593 F4 f = FUNCTION_CAST<F4>(Code::cast(code)->entry()); |
| 594 CHECK_EQ(0x7FF80000, f(OS::nan_value())); |
| 595 } |
| 596 |
| 597 |
567 #undef __ | 598 #undef __ |
OLD | NEW |