| 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 // CpuFeatures::Scope fscope(SSE3); | 354 // CpuFeatures::Scope fscope(SSE3); |
| 355 // // Generate SSE3 floating point code. | 355 // // Generate SSE3 floating point code. |
| 356 // } else { | 356 // } else { |
| 357 // // Generate standard x87 or SSE2 floating point code. | 357 // // Generate standard x87 or SSE2 floating point code. |
| 358 // } | 358 // } |
| 359 class CpuFeatures : public AllStatic { | 359 class CpuFeatures : public AllStatic { |
| 360 public: | 360 public: |
| 361 // Feature flags bit positions. They are mostly based on the CPUID spec. | 361 // Feature flags bit positions. They are mostly based on the CPUID spec. |
| 362 // (We assign CPUID itself to one of the currently reserved bits -- | 362 // (We assign CPUID itself to one of the currently reserved bits -- |
| 363 // feel free to change this if needed.) | 363 // feel free to change this if needed.) |
| 364 enum Feature { SSE3 = 32, SSE2 = 26, CMOV = 15, RDTSC = 4, CPUID = 10 }; | 364 enum Feature { SSE3 = 32, |
| 365 SSE2 = 26, |
| 366 CMOV = 15, |
| 367 RDTSC = 4, |
| 368 CPUID = 10, |
| 369 SAHF = 0}; |
| 365 // Detect features of the target CPU. Set safe defaults if the serializer | 370 // Detect features of the target CPU. Set safe defaults if the serializer |
| 366 // is enabled (snapshots must be portable). | 371 // is enabled (snapshots must be portable). |
| 367 static void Probe(); | 372 static void Probe(); |
| 368 // Check whether a feature is supported by the target CPU. | 373 // Check whether a feature is supported by the target CPU. |
| 369 static bool IsSupported(Feature f) { | 374 static bool IsSupported(Feature f) { |
| 370 return (supported_ & (V8_UINT64_C(1) << f)) != 0; | 375 return (supported_ & (V8_UINT64_C(1) << f)) != 0; |
| 371 } | 376 } |
| 372 // Check whether a feature is currently enabled. | 377 // Check whether a feature is currently enabled. |
| 373 static bool IsEnabled(Feature f) { | 378 static bool IsEnabled(Feature f) { |
| 374 return (enabled_ & (V8_UINT64_C(1) << f)) != 0; | 379 return (enabled_ & (V8_UINT64_C(1) << f)) != 0; |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 private: | 1295 private: |
| 1291 Assembler* assembler_; | 1296 Assembler* assembler_; |
| 1292 #ifdef DEBUG | 1297 #ifdef DEBUG |
| 1293 int space_before_; | 1298 int space_before_; |
| 1294 #endif | 1299 #endif |
| 1295 }; | 1300 }; |
| 1296 | 1301 |
| 1297 } } // namespace v8::internal | 1302 } } // namespace v8::internal |
| 1298 | 1303 |
| 1299 #endif // V8_X64_ASSEMBLER_X64_H_ | 1304 #endif // V8_X64_ASSEMBLER_X64_H_ |
| OLD | NEW |