[clang][X86] Add __cpuidex function to cpuid.h
authorAiden Grossman <agrossman154@yahoo.com>
Wed, 17 May 2023 18:01:37 +0000 (18:01 +0000)
committerAiden Grossman <agrossman154@yahoo.com>
Wed, 17 May 2023 19:38:28 +0000 (19:38 +0000)
commit286cefcf35d0f55c57184c4219b95e82c96f1420
treebbe8b62c7a272302810e602fd9164c8937f68dc3
parente91123fb1b8146b087571d2052a5adbbc9400c9f
[clang][X86] Add __cpuidex function to cpuid.h

MSVC has a `__cpuidex` function implemented to call the underlying cpuid
instruction which accepts a leaf, subleaf, and data array that the output
data is written into. This patch adds this functionality into clang
under the cpuid.h header. This also makes clang match GCC's behavior.
GCC has had `__cpuidex` in its cpuid.h since 2020.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D150646
clang/lib/Headers/cpuid.h
clang/test/Headers/cpuid.c