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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) { | 567 TEST(AssemblerIa32Extractps) { |
568 CcTest::InitializeVM(); | 568 CcTest::InitializeVM(); |
569 if (!CpuFeatures::IsSupported(SSE4_1)) return; | 569 if (!CpuFeatures::IsSupported(SSE2) || |
| 570 !CpuFeatures::IsSupported(SSE4_1)) return; |
570 | 571 |
571 Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate()); | 572 Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate()); |
572 HandleScope scope(isolate); | 573 HandleScope scope(isolate); |
573 v8::internal::byte buffer[256]; | 574 v8::internal::byte buffer[256]; |
574 MacroAssembler assm(isolate, buffer, sizeof buffer); | 575 MacroAssembler assm(isolate, buffer, sizeof buffer); |
575 { CpuFeatureScope fscope2(&assm, SSE2); | 576 { CpuFeatureScope fscope2(&assm, SSE2); |
576 CpuFeatureScope fscope41(&assm, SSE4_1); | 577 CpuFeatureScope fscope41(&assm, SSE4_1); |
577 __ movdbl(xmm1, Operand(esp, 4)); | 578 __ movdbl(xmm1, Operand(esp, 4)); |
578 __ extractps(eax, xmm1, 0x1); | 579 __ extractps(eax, xmm1, 0x1); |
579 __ ret(0); | 580 __ ret(0); |
(...skipping 12 matching lines...) Expand all Loading... |
592 | 593 |
593 F4 f = FUNCTION_CAST<F4>(Code::cast(code)->entry()); | 594 F4 f = FUNCTION_CAST<F4>(Code::cast(code)->entry()); |
594 uint64_t value1 = V8_2PART_UINT64_C(0x12345678, 87654321); | 595 uint64_t value1 = V8_2PART_UINT64_C(0x12345678, 87654321); |
595 CHECK_EQ(0x12345678, f(uint64_to_double(value1))); | 596 CHECK_EQ(0x12345678, f(uint64_to_double(value1))); |
596 uint64_t value2 = V8_2PART_UINT64_C(0x87654321, 12345678); | 597 uint64_t value2 = V8_2PART_UINT64_C(0x87654321, 12345678); |
597 CHECK_EQ(0x87654321, f(uint64_to_double(value2))); | 598 CHECK_EQ(0x87654321, f(uint64_to_double(value2))); |
598 } | 599 } |
599 | 600 |
600 | 601 |
601 #undef __ | 602 #undef __ |
OLD | NEW |