Commit 8f538e5f authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Namespace preprocessor names in folly/CpuId.h

Summary: [Folly] Namespace preprocessor names in `folly/CpuId.h`.

Reviewed By: LeeHowes

Differential Revision: D17780995

fbshipit-source-id: 29580e780a4f8639c4247b9af38f47182fc000bb
parent 2b127db9
......@@ -105,108 +105,108 @@ class CpuId {
#endif
}
#define X(name, r, bit) \
FOLLY_ALWAYS_INLINE bool name() const { \
return ((r) & (1U << bit)) != 0; \
#define FOLLY_DETAIL_CPUID_X(name, r, bit) \
FOLLY_ALWAYS_INLINE bool name() const { \
return ((r) & (1U << bit)) != 0; \
}
// cpuid(1): Processor Info and Feature Bits.
#define C(name, bit) X(name, f1c_, bit)
C(sse3, 0)
C(pclmuldq, 1)
C(dtes64, 2)
C(monitor, 3)
C(dscpl, 4)
C(vmx, 5)
C(smx, 6)
C(eist, 7)
C(tm2, 8)
C(ssse3, 9)
C(cnxtid, 10)
C(fma, 12)
C(cx16, 13)
C(xtpr, 14)
C(pdcm, 15)
C(pcid, 17)
C(dca, 18)
C(sse41, 19)
C(sse42, 20)
C(x2apic, 21)
C(movbe, 22)
C(popcnt, 23)
C(tscdeadline, 24)
C(aes, 25)
C(xsave, 26)
C(osxsave, 27)
C(avx, 28)
C(f16c, 29)
C(rdrand, 30)
#undef C
#define D(name, bit) X(name, f1d_, bit)
D(fpu, 0)
D(vme, 1)
D(de, 2)
D(pse, 3)
D(tsc, 4)
D(msr, 5)
D(pae, 6)
D(mce, 7)
D(cx8, 8)
D(apic, 9)
D(sep, 11)
D(mtrr, 12)
D(pge, 13)
D(mca, 14)
D(cmov, 15)
D(pat, 16)
D(pse36, 17)
D(psn, 18)
D(clfsh, 19)
D(ds, 21)
D(acpi, 22)
D(mmx, 23)
D(fxsr, 24)
D(sse, 25)
D(sse2, 26)
D(ss, 27)
D(htt, 28)
D(tm, 29)
D(pbe, 31)
#undef D
#define FOLLY_DETAIL_CPUID_C(name, bit) FOLLY_DETAIL_CPUID_X(name, f1c_, bit)
FOLLY_DETAIL_CPUID_C(sse3, 0)
FOLLY_DETAIL_CPUID_C(pclmuldq, 1)
FOLLY_DETAIL_CPUID_C(dtes64, 2)
FOLLY_DETAIL_CPUID_C(monitor, 3)
FOLLY_DETAIL_CPUID_C(dscpl, 4)
FOLLY_DETAIL_CPUID_C(vmx, 5)
FOLLY_DETAIL_CPUID_C(smx, 6)
FOLLY_DETAIL_CPUID_C(eist, 7)
FOLLY_DETAIL_CPUID_C(tm2, 8)
FOLLY_DETAIL_CPUID_C(ssse3, 9)
FOLLY_DETAIL_CPUID_C(cnxtid, 10)
FOLLY_DETAIL_CPUID_C(fma, 12)
FOLLY_DETAIL_CPUID_C(cx16, 13)
FOLLY_DETAIL_CPUID_C(xtpr, 14)
FOLLY_DETAIL_CPUID_C(pdcm, 15)
FOLLY_DETAIL_CPUID_C(pcid, 17)
FOLLY_DETAIL_CPUID_C(dca, 18)
FOLLY_DETAIL_CPUID_C(sse41, 19)
FOLLY_DETAIL_CPUID_C(sse42, 20)
FOLLY_DETAIL_CPUID_C(x2apic, 21)
FOLLY_DETAIL_CPUID_C(movbe, 22)
FOLLY_DETAIL_CPUID_C(popcnt, 23)
FOLLY_DETAIL_CPUID_C(tscdeadline, 24)
FOLLY_DETAIL_CPUID_C(aes, 25)
FOLLY_DETAIL_CPUID_C(xsave, 26)
FOLLY_DETAIL_CPUID_C(osxsave, 27)
FOLLY_DETAIL_CPUID_C(avx, 28)
FOLLY_DETAIL_CPUID_C(f16c, 29)
FOLLY_DETAIL_CPUID_C(rdrand, 30)
#undef FOLLY_DETAIL_CPUID_C
#define FOLLY_DETAIL_CPUID_D(name, bit) FOLLY_DETAIL_CPUID_X(name, f1d_, bit)
FOLLY_DETAIL_CPUID_D(fpu, 0)
FOLLY_DETAIL_CPUID_D(vme, 1)
FOLLY_DETAIL_CPUID_D(de, 2)
FOLLY_DETAIL_CPUID_D(pse, 3)
FOLLY_DETAIL_CPUID_D(tsc, 4)
FOLLY_DETAIL_CPUID_D(msr, 5)
FOLLY_DETAIL_CPUID_D(pae, 6)
FOLLY_DETAIL_CPUID_D(mce, 7)
FOLLY_DETAIL_CPUID_D(cx8, 8)
FOLLY_DETAIL_CPUID_D(apic, 9)
FOLLY_DETAIL_CPUID_D(sep, 11)
FOLLY_DETAIL_CPUID_D(mtrr, 12)
FOLLY_DETAIL_CPUID_D(pge, 13)
FOLLY_DETAIL_CPUID_D(mca, 14)
FOLLY_DETAIL_CPUID_D(cmov, 15)
FOLLY_DETAIL_CPUID_D(pat, 16)
FOLLY_DETAIL_CPUID_D(pse36, 17)
FOLLY_DETAIL_CPUID_D(psn, 18)
FOLLY_DETAIL_CPUID_D(clfsh, 19)
FOLLY_DETAIL_CPUID_D(ds, 21)
FOLLY_DETAIL_CPUID_D(acpi, 22)
FOLLY_DETAIL_CPUID_D(mmx, 23)
FOLLY_DETAIL_CPUID_D(fxsr, 24)
FOLLY_DETAIL_CPUID_D(sse, 25)
FOLLY_DETAIL_CPUID_D(sse2, 26)
FOLLY_DETAIL_CPUID_D(ss, 27)
FOLLY_DETAIL_CPUID_D(htt, 28)
FOLLY_DETAIL_CPUID_D(tm, 29)
FOLLY_DETAIL_CPUID_D(pbe, 31)
#undef FOLLY_DETAIL_CPUID_D
// cpuid(7): Extended Features.
#define B(name, bit) X(name, f7b_, bit)
B(bmi1, 3)
B(hle, 4)
B(avx2, 5)
B(smep, 7)
B(bmi2, 8)
B(erms, 9)
B(invpcid, 10)
B(rtm, 11)
B(mpx, 14)
B(avx512f, 16)
B(avx512dq, 17)
B(rdseed, 18)
B(adx, 19)
B(smap, 20)
B(avx512ifma, 21)
B(pcommit, 22)
B(clflushopt, 23)
B(clwb, 24)
B(avx512pf, 26)
B(avx512er, 27)
B(avx512cd, 28)
B(sha, 29)
B(avx512bw, 30)
B(avx512vl, 31)
#undef B
#define C(name, bit) X(name, f7c_, bit)
C(prefetchwt1, 0)
C(avx512vbmi, 1)
#undef C
#define FOLLY_DETAIL_CPUID_B(name, bit) FOLLY_DETAIL_CPUID_X(name, f7b_, bit)
FOLLY_DETAIL_CPUID_B(bmi1, 3)
FOLLY_DETAIL_CPUID_B(hle, 4)
FOLLY_DETAIL_CPUID_B(avx2, 5)
FOLLY_DETAIL_CPUID_B(smep, 7)
FOLLY_DETAIL_CPUID_B(bmi2, 8)
FOLLY_DETAIL_CPUID_B(erms, 9)
FOLLY_DETAIL_CPUID_B(invpcid, 10)
FOLLY_DETAIL_CPUID_B(rtm, 11)
FOLLY_DETAIL_CPUID_B(mpx, 14)
FOLLY_DETAIL_CPUID_B(avx512f, 16)
FOLLY_DETAIL_CPUID_B(avx512dq, 17)
FOLLY_DETAIL_CPUID_B(rdseed, 18)
FOLLY_DETAIL_CPUID_B(adx, 19)
FOLLY_DETAIL_CPUID_B(smap, 20)
FOLLY_DETAIL_CPUID_B(avx512ifma, 21)
FOLLY_DETAIL_CPUID_B(pcommit, 22)
FOLLY_DETAIL_CPUID_B(clflushopt, 23)
FOLLY_DETAIL_CPUID_B(clwb, 24)
FOLLY_DETAIL_CPUID_B(avx512pf, 26)
FOLLY_DETAIL_CPUID_B(avx512er, 27)
FOLLY_DETAIL_CPUID_B(avx512cd, 28)
FOLLY_DETAIL_CPUID_B(sha, 29)
FOLLY_DETAIL_CPUID_B(avx512bw, 30)
FOLLY_DETAIL_CPUID_B(avx512vl, 31)
#undef FOLLY_DETAIL_CPUID_B
#define FOLLY_DETAIL_CPUID_C(name, bit) FOLLY_DETAIL_CPUID_X(name, f7c_, bit)
FOLLY_DETAIL_CPUID_C(prefetchwt1, 0)
FOLLY_DETAIL_CPUID_C(avx512vbmi, 1)
#undef FOLLY_DETAIL_CPUID_C
#undef X
#undef FOLLY_DETAIL_CPUID_X
private:
uint32_t f1c_ = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment