OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // ----------------------------------------------------------------------------- | 48 // ----------------------------------------------------------------------------- |
49 // Implementation of CpuFeatures | 49 // Implementation of CpuFeatures |
50 | 50 |
51 #ifdef DEBUG | 51 #ifdef DEBUG |
52 bool CpuFeatures::initialized_ = false; | 52 bool CpuFeatures::initialized_ = false; |
53 #endif | 53 #endif |
54 uint64_t CpuFeatures::supported_ = 0; | 54 uint64_t CpuFeatures::supported_ = 0; |
55 uint64_t CpuFeatures::found_by_runtime_probing_ = 0; | 55 uint64_t CpuFeatures::found_by_runtime_probing_ = 0; |
56 | 56 |
57 | 57 |
| 58 int IntelDoubleRegister::NumAllocatableRegisters() { |
| 59 if (CpuFeatures::IsSupported(SSE2)) { |
| 60 return XMMRegister::kNumAllocatableRegisters; |
| 61 } else { |
| 62 return X87TopOfStackProxyRegister::kNumAllocatableRegisters; |
| 63 } |
| 64 } |
| 65 |
| 66 |
| 67 int IntelDoubleRegister::NumRegisters() { |
| 68 if (CpuFeatures::IsSupported(SSE2)) { |
| 69 return XMMRegister::kNumRegisters; |
| 70 } else { |
| 71 return X87TopOfStackProxyRegister::kNumRegisters; |
| 72 } |
| 73 } |
| 74 |
| 75 |
| 76 const char* IntelDoubleRegister::AllocationIndexToString(int index) { |
| 77 if (CpuFeatures::IsSupported(SSE2)) { |
| 78 return XMMRegister::AllocationIndexToString(index); |
| 79 } else { |
| 80 return X87TopOfStackProxyRegister::AllocationIndexToString(index); |
| 81 } |
| 82 } |
| 83 |
| 84 |
58 // The Probe method needs executable memory, so it uses Heap::CreateCode. | 85 // The Probe method needs executable memory, so it uses Heap::CreateCode. |
59 // Allocation failure is silent and leads to safe default. | 86 // Allocation failure is silent and leads to safe default. |
60 void CpuFeatures::Probe() { | 87 void CpuFeatures::Probe() { |
61 ASSERT(!initialized_); | 88 ASSERT(!initialized_); |
62 ASSERT(supported_ == 0); | 89 ASSERT(supported_ == 0); |
63 #ifdef DEBUG | 90 #ifdef DEBUG |
64 initialized_ = true; | 91 initialized_ = true; |
65 #endif | 92 #endif |
66 if (Serializer::enabled()) { | 93 if (Serializer::enabled()) { |
67 supported_ |= OS::CpuFeaturesImpliedByPlatform(); | 94 supported_ |= OS::CpuFeaturesImpliedByPlatform(); |
(...skipping 2144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2212 EMIT(0xE7); | 2239 EMIT(0xE7); |
2213 emit_sse_operand(src, dst); | 2240 emit_sse_operand(src, dst); |
2214 } | 2241 } |
2215 | 2242 |
2216 | 2243 |
2217 void Assembler::prefetch(const Operand& src, int level) { | 2244 void Assembler::prefetch(const Operand& src, int level) { |
2218 ASSERT(is_uint2(level)); | 2245 ASSERT(is_uint2(level)); |
2219 EnsureSpace ensure_space(this); | 2246 EnsureSpace ensure_space(this); |
2220 EMIT(0x0F); | 2247 EMIT(0x0F); |
2221 EMIT(0x18); | 2248 EMIT(0x18); |
2222 XMMRegister code = { level }; // Emit hint number in Reg position of RegR/M. | 2249 // Emit hint number in Reg position of RegR/M. |
| 2250 XMMRegister code = XMMRegister(level); |
2223 emit_sse_operand(code, src); | 2251 emit_sse_operand(code, src); |
2224 } | 2252 } |
2225 | 2253 |
2226 | 2254 |
2227 void Assembler::movdbl(XMMRegister dst, const Operand& src) { | 2255 void Assembler::movdbl(XMMRegister dst, const Operand& src) { |
2228 EnsureSpace ensure_space(this); | 2256 EnsureSpace ensure_space(this); |
2229 movsd(dst, src); | 2257 movsd(dst, src); |
2230 } | 2258 } |
2231 | 2259 |
2232 | 2260 |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2664 fprintf(coverage_log, "%s\n", file_line); | 2692 fprintf(coverage_log, "%s\n", file_line); |
2665 fflush(coverage_log); | 2693 fflush(coverage_log); |
2666 } | 2694 } |
2667 } | 2695 } |
2668 | 2696 |
2669 #endif | 2697 #endif |
2670 | 2698 |
2671 } } // namespace v8::internal | 2699 } } // namespace v8::internal |
2672 | 2700 |
2673 #endif // V8_TARGET_ARCH_IA32 | 2701 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |