Skip to content

Commit

Permalink
Revert "[clang][X86] Add __cpuidex function to cpuid.h"
Browse files Browse the repository at this point in the history
This reverts commit 286cefc.

Patch caused build failures for downstream projects on Windows due to
the fact that __cpuidex was added as a built in on Windows in D121653.
Reverting for now so that others aren't blocked and I can figure out a
proper solution.
  • Loading branch information
boomanaiden154 committed May 18, 2023
1 parent a3ef1b5 commit 4acee5b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
6 changes: 0 additions & 6 deletions clang/lib/Headers/cpuid.h
Expand Up @@ -328,10 +328,4 @@ static __inline int __get_cpuid_count (unsigned int __leaf,
return 1;
}

static __inline void __cpuidex (int __cpu_info[4], int __leaf, int __subleaf)
{
__cpuid_count(__leaf, __subleaf, __cpu_info[0], __cpu_info[1], __cpu_info[2],
__cpu_info[3]);
}

#endif /* __CPUID_H */
5 changes: 0 additions & 5 deletions clang/test/Headers/cpuid.c
Expand Up @@ -6,19 +6,14 @@

// 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]+}})
// 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]+}})
// 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]+}})

// CHECK-32: {{.*}} call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %{{[a-z0-9]+}})
// 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]+}})
// 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]+}})

unsigned eax0, ebx0, ecx0, edx0;
unsigned eax1, ebx1, ecx1, edx1;

int cpuid_info[4];

void test_cpuid(unsigned level, unsigned count) {
__cpuid(level, eax1, ebx1, ecx1, edx1);
__cpuid_count(level, count, eax0, ebx0, ecx0, edx0);
__cpuidex(cpuid_info, level, count);
}

0 comments on commit 4acee5b

Please sign in to comment.