OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 __ pop(rax); | 67 __ pop(rax); |
68 __ movq(rdx, rax); | 68 __ movq(rdx, rax); |
69 __ xor_(rax, Immediate(0x200000)); // Flip bit 21. | 69 __ xor_(rax, Immediate(0x200000)); // Flip bit 21. |
70 __ push(rax); | 70 __ push(rax); |
71 __ popfq(); | 71 __ popfq(); |
72 __ pushfq(); | 72 __ pushfq(); |
73 __ pop(rax); | 73 __ pop(rax); |
74 __ xor_(rax, rdx); // Different if CPUID is supported. | 74 __ xor_(rax, rdx); // Different if CPUID is supported. |
75 __ j(not_zero, &cpuid); | 75 __ j(not_zero, &cpuid); |
76 | 76 |
77 // CPUID not supported. Clear the supported features in edx:eax. | 77 // CPUID not supported. Clear the supported features in rax. |
78 __ xor_(rax, rax); | 78 __ xor_(rax, rax); |
79 __ jmp(&done); | 79 __ jmp(&done); |
80 | 80 |
81 // Invoke CPUID with 1 in eax to get feature information in | 81 // Invoke CPUID with 1 in eax to get feature information in |
82 // ecx:edx. Temporarily enable CPUID support because we know it's | 82 // ecx:edx. Temporarily enable CPUID support because we know it's |
83 // safe here. | 83 // safe here. |
84 __ bind(&cpuid); | 84 __ bind(&cpuid); |
85 __ movq(rax, Immediate(1)); | 85 __ movq(rax, Immediate(1)); |
86 supported_ = kDefaultCpuFeatures | (1 << CPUID); | 86 supported_ = kDefaultCpuFeatures | (1 << CPUID); |
87 { Scope fscope(CPUID); | 87 { Scope fscope(CPUID); |
(...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2987 // specially coded on x64 means that it is a relative 32 bit address, as used | 2987 // specially coded on x64 means that it is a relative 32 bit address, as used |
2988 // by branch instructions. | 2988 // by branch instructions. |
2989 return (1 << rmode_) & kApplyMask; | 2989 return (1 << rmode_) & kApplyMask; |
2990 } | 2990 } |
2991 | 2991 |
2992 | 2992 |
2993 | 2993 |
2994 } } // namespace v8::internal | 2994 } } // namespace v8::internal |
2995 | 2995 |
2996 #endif // V8_TARGET_ARCH_X64 | 2996 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |