Changeset 37235 in webkit for trunk/JavaScriptCore/VM
- Timestamp:
- Oct 3, 2008, 4:11:55 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CTI.cpp
r37160 r37235 43 43 44 44 #if PLATFORM(MAC) 45 bool isSSE3Present() 46 { 47 struct SSE3Check { 48 SSE3Check() 45 bool isSSE2Present() 46 { 47 return true; // All X86 Macs are guaranteed to support at least SSE2 48 } 49 #else COMPILER(MSVC) 50 bool isSSE2Present() 51 { 52 static const int SSE2FeatureBit = 1 << 26; 53 struct SSE2Check { 54 SSE2Check() 49 55 { 50 int hasSSE3 = 0; 51 size_t length = sizeof(hasSSE3); 52 int error = sysctlbyname("hw.optional.sse3", &hasSSE3, &length, NULL, 0); 53 present = hasSSE3 && !error; 56 int flags; 57 #if COMPILER(MSVC) 58 _asm { 59 mov eax, 1 // cpuid function 1 gives us the standard feature set 60 cpuid; 61 mov flags, edx; 62 } 63 #else 64 flags = 0; 65 // FIXME: Add GCC code to do above asm 66 #endif 67 present = (flags & SSE2FeatureBit) != 0; 54 68 } 55 69 bool present; 56 70 }; 57 static SSE 3Check check;71 static SSE2Check check; 58 72 return check.present; 59 }60 #else61 bool isSSE3Present()62 {63 return false;64 73 } 65 74 #endif … … 672 681 emitGetArg(src2, X86::edx); 673 682 674 if (types.second().isReusable() && isSSE 3Present()) {683 if (types.second().isReusable() && isSSE2Present()) { 675 684 ASSERT(types.second().mightBeNumber()); 676 685 … … 719 728 m_jit.link(op2imm, m_jit.label()); 720 729 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 721 } else if (types.first().isReusable() && isSSE 3Present()) {730 } else if (types.first().isReusable() && isSSE2Present()) { 722 731 ASSERT(types.first().mightBeNumber()); 723 732 … … 790 799 emitPutResult(dst); 791 800 792 if (types.second().isReusable() && isSSE 3Present()) {801 if (types.second().isReusable() && isSSE2Present()) { 793 802 m_jit.link(wasJSNumberCell2, m_jit.label()); 794 803 m_jit.link(wasJSNumberCell2b, m_jit.label()); 795 804 } 796 else if (types.first().isReusable() && isSSE 3Present()) {805 else if (types.first().isReusable() && isSSE2Present()) { 797 806 m_jit.link(wasJSNumberCell1, m_jit.label()); 798 807 m_jit.link(wasJSNumberCell1b, m_jit.label()); … … 804 813 X86Assembler::JmpDst here = m_jit.label(); 805 814 m_jit.link(iter->from, here); 806 if (types.second().isReusable() && isSSE 3Present()) {815 if (types.second().isReusable() && isSSE2Present()) { 807 816 if (!types.first().definitelyIsNumber()) { 808 817 m_jit.link((++iter)->from, here); … … 814 823 } 815 824 m_jit.link((++iter)->from, here); 816 } else if (types.first().isReusable() && isSSE 3Present()) {825 } else if (types.first().isReusable() && isSSE2Present()) { 817 826 if (!types.first().definitelyIsNumber()) { 818 827 m_jit.link((++iter)->from, here);
Note:
See TracChangeset
for help on using the changeset viewer.