Skip to content

Commit af23bb5

Browse files
boomanaiden154tru
authored andcommitted
Revert "[clang][X86] Add __cpuidex function to cpuid.h"
This reverts commit 2df77ac. This has been causing some issues with some windows builds as _MSC_EXTENSIONS isn't defined when only -fms-extensions is set, but the builtin that conflicts with __cpuidex is. This was also causing problems as it exposed some latent issues with how auxiliary triples are handled in clang. Differential Revision: https://reviews.llvm.org/D157115 (cherry picked from commit f3baf63)
1 parent 3fc4317 commit af23bb5

File tree

3 files changed

+0
-30
lines changed

3 files changed

+0
-30
lines changed

clang/lib/Headers/cpuid.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,4 @@ static __inline int __get_cpuid_count (unsigned int __leaf,
328328
return 1;
329329
}
330330

331-
// If MS extensions are enabled, __cpuidex is defined as a builtin which will
332-
// conflict with the __cpuidex definition below.
333-
#ifndef _MSC_EXTENSIONS
334-
static __inline void __cpuidex (int __cpu_info[4], int __leaf, int __subleaf)
335-
{
336-
__cpuid_count(__leaf, __subleaf, __cpu_info[0], __cpu_info[1], __cpu_info[2],
337-
__cpu_info[3]);
338-
}
339-
#endif
340-
341331
#endif /* __CPUID_H */

clang/test/Headers/__cpuidex_conflict.c

Lines changed: 0 additions & 15 deletions
This file was deleted.

clang/test/Headers/cpuid.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@
66

77
// CHECK-64: {{.*}} call { i32, i32, i32, i32 } asm " xchgq %rbx,${1:q}\0A cpuid\0A xchgq %rbx,${1:q}", "={ax},=r,={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %{{[a-z0-9]+}})
88
// CHECK-64: {{.*}} call { i32, i32, i32, i32 } asm " xchgq %rbx,${1:q}\0A cpuid\0A xchgq %rbx,${1:q}", "={ax},=r,={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 %{{[a-z0-9]+}}, i32 %{{[a-z0-9]+}})
9-
// CHECK-64: {{.*}} call { i32, i32, i32, i32 } asm " xchgq %rbx,${1:q}\0A cpuid\0A xchgq %rbx,${1:q}", "={ax},=r,={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 %{{[a-z0-9]+}}, i32 %{{[a-z0-9]+}})
109

1110
// CHECK-32: {{.*}} call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %{{[a-z0-9]+}})
1211
// CHECK-32: {{.*}} call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 %{{[a-z0-9]+}}, i32 %{{[a-z0-9]+}})
13-
// CHECK-32: {{.*}} call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 %{{[a-z0-9]+}}, i32 %{{[a-z0-9]+}})
1412

1513
unsigned eax0, ebx0, ecx0, edx0;
1614
unsigned eax1, ebx1, ecx1, edx1;
1715

18-
int cpuid_info[4];
19-
2016
void test_cpuid(unsigned level, unsigned count) {
2117
__cpuid(level, eax1, ebx1, ecx1, edx1);
2218
__cpuid_count(level, count, eax0, ebx0, ecx0, edx0);
23-
__cpuidex(cpuid_info, level, count);
2419
}

0 commit comments

Comments
 (0)