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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 // } | 369 // } |
370 class CpuFeatures : public AllStatic { | 370 class CpuFeatures : public AllStatic { |
371 public: | 371 public: |
372 // Detect features of the target CPU. Set safe defaults if the serializer | 372 // Detect features of the target CPU. Set safe defaults if the serializer |
373 // is enabled (snapshots must be portable). | 373 // is enabled (snapshots must be portable). |
374 static void Probe(); | 374 static void Probe(); |
375 // Check whether a feature is supported by the target CPU. | 375 // Check whether a feature is supported by the target CPU. |
376 static bool IsSupported(CpuFeature f) { | 376 static bool IsSupported(CpuFeature f) { |
377 if (f == SSE2 && !FLAG_enable_sse2) return false; | 377 if (f == SSE2 && !FLAG_enable_sse2) return false; |
378 if (f == SSE3 && !FLAG_enable_sse3) return false; | 378 if (f == SSE3 && !FLAG_enable_sse3) return false; |
| 379 if (f == SSE4_1 && !FLAG_enable_sse4_1) return false; |
379 if (f == CMOV && !FLAG_enable_cmov) return false; | 380 if (f == CMOV && !FLAG_enable_cmov) return false; |
380 if (f == RDTSC && !FLAG_enable_rdtsc) return false; | 381 if (f == RDTSC && !FLAG_enable_rdtsc) return false; |
381 return (supported_ & (static_cast<uint64_t>(1) << f)) != 0; | 382 return (supported_ & (static_cast<uint64_t>(1) << f)) != 0; |
382 } | 383 } |
383 // Check whether a feature is currently enabled. | 384 // Check whether a feature is currently enabled. |
384 static bool IsEnabled(CpuFeature f) { | 385 static bool IsEnabled(CpuFeature f) { |
385 return (enabled_ & (static_cast<uint64_t>(1) << f)) != 0; | 386 return (enabled_ & (static_cast<uint64_t>(1) << f)) != 0; |
386 } | 387 } |
387 // Enable a specified feature within a scope. | 388 // Enable a specified feature within a scope. |
388 class Scope BASE_EMBEDDED { | 389 class Scope BASE_EMBEDDED { |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 private: | 979 private: |
979 Assembler* assembler_; | 980 Assembler* assembler_; |
980 #ifdef DEBUG | 981 #ifdef DEBUG |
981 int space_before_; | 982 int space_before_; |
982 #endif | 983 #endif |
983 }; | 984 }; |
984 | 985 |
985 } } // namespace v8::internal | 986 } } // namespace v8::internal |
986 | 987 |
987 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 988 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
OLD | NEW |