Skip to content

Commit 804e453

Browse files
RKSimontru
authored andcommitted
[X86] Add RDPRU instruction CPUID bit masks
As mentioned on D128934 - we weren't including the CPUID bit handling for the RDPRU instruction AMD's APMv3 (24594) lists it as CPUID Fn8000_0008_EBX Bit#4 (cherry picked from commit 08a8805)
1 parent 76522bf commit 804e453

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

clang/lib/Headers/cpuid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232

233233
/* Features in %ebx for leaf 0x80000008 */
234234
#define bit_CLZERO 0x00000001
235+
#define bit_RDPRU 0x00000010
235236
#define bit_WBNOINVD 0x00000200
236237

237238

llvm/lib/Support/Host.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,7 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
17341734
bool HasExtLeaf8 = MaxExtLevel >= 0x80000008 &&
17351735
!getX86CpuIDAndInfo(0x80000008, &EAX, &EBX, &ECX, &EDX);
17361736
Features["clzero"] = HasExtLeaf8 && ((EBX >> 0) & 1);
1737+
Features["rdpru"] = HasExtLeaf8 && ((EBX >> 4) & 1);
17371738
Features["wbnoinvd"] = HasExtLeaf8 && ((EBX >> 9) & 1);
17381739

17391740
bool HasLeaf7 =

0 commit comments

Comments
 (0)