OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 // Compile time assertion: sizeof(Dest) == sizeof(Source) | 569 // Compile time assertion: sizeof(Dest) == sizeof(Source) |
570 // A compile error here means your Dest and Source have different sizes. | 570 // A compile error here means your Dest and Source have different sizes. |
571 typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1]; | 571 typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1]; |
572 | 572 |
573 Dest dest; | 573 Dest dest; |
574 memcpy(&dest, &source, sizeof(dest)); | 574 memcpy(&dest, &source, sizeof(dest)); |
575 return dest; | 575 return dest; |
576 } | 576 } |
577 | 577 |
578 | 578 |
| 579 // Feature flags bit positions. They are mostly based on the CPUID spec. |
| 580 // (We assign CPUID itself to one of the currently reserved bits -- |
| 581 // feel free to change this if needed.) |
| 582 enum CpuFeature { SSE3 = 32, // x86 |
| 583 SSE2 = 26, // x86 |
| 584 CMOV = 15, // x86 |
| 585 RDTSC = 4, // x86 |
| 586 CPUID = 10, // x86 |
| 587 VFP3 = 1, // ARM |
| 588 SAHF = 0}; // x86 |
| 589 |
579 } } // namespace v8::internal | 590 } } // namespace v8::internal |
580 | 591 |
581 #endif // V8_GLOBALS_H_ | 592 #endif // V8_GLOBALS_H_ |
OLD | NEW |