| ... | ... | @@ -79,8 +79,6 @@ |
| 79 | 79 | |
| 80 | 80 | #if defined(zig_msvc) |
| 81 | 81 | #include <intrin.h> |
| 82 | | #elif defined(zig_x86) |
| 83 | | #include <cpuid.h> |
| 84 | 82 | #endif |
| 85 | 83 | |
| 86 | 84 | #if __STDC_VERSION__ >= 202311L |
| ... | ... | @@ -4058,19 +4056,29 @@ static inline void zig_x86_cpuid(uint32_t leaf_id, uint32_t subid, uint32_t* eax |
| 4058 | 4056 | *ebx = (uint32_t)cpu_info[1]; |
| 4059 | 4057 | *ecx = (uint32_t)cpu_info[2]; |
| 4060 | 4058 | *edx = (uint32_t)cpu_info[3]; |
| 4059 | #elif defined(zig_gnuc) || defined(zig_tinyc) || defined(zig_slimcc) |
| 4060 | __asm__("cpuid" : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx) : "a"(leaf_id), "c"(subid)); |
| 4061 | 4061 | #else |
| 4062 | | __cpuid_count(leaf_id, subid, *eax, *ebx, *ecx, *edx); |
| 4062 | *eax = 0; |
| 4063 | *ebx = 0; |
| 4064 | *ecx = 0; |
| 4065 | *edx = 0; |
| 4063 | 4066 | #endif |
| 4064 | 4067 | } |
| 4065 | 4068 | |
| 4066 | 4069 | static inline uint32_t zig_x86_get_xcr0(void) { |
| 4067 | 4070 | #if defined(zig_msvc) |
| 4068 | 4071 | return (uint32_t)_xgetbv(0); |
| 4069 | | #else |
| 4072 | #elif defined(zig_gnuc) || defined(zig_tinyc) || defined(zig_slimcc) |
| 4070 | 4073 | uint32_t eax; |
| 4071 | 4074 | uint32_t edx; |
| 4072 | 4075 | __asm__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(0)); |
| 4073 | 4076 | return eax; |
| 4077 | #else |
| 4078 | *eax = 0; |
| 4079 | *ebx = 0; |
| 4080 | *ecx = 0; |
| 4081 | *edx = 0; |
| 4074 | 4082 | #endif |
| 4075 | 4083 | } |
| 4076 | 4084 | |