diff options
author | Marat Dukhan <marat@fb.com> | 2017-09-26 11:02:37 -0700 |
---|---|---|
committer | Marat Dukhan <marat@fb.com> | 2017-09-26 11:02:37 -0700 |
commit | 9e32e8de80d4161c290083cdae962b1a59b08a76 (patch) | |
tree | 1ebef6c790a0196b295d9f6556213b758c3585d4 /include/cpuinfo.h | |
parent | 9da4c918ea33edcc1b10409391ea1765e92b5056 (diff) | |
download | cpuinfo-9e32e8de80d4161c290083cdae962b1a59b08a76.tar.gz |
cpuinfo_has_x86_* functions for TM and MPX
Diffstat (limited to 'include/cpuinfo.h')
-rw-r--r-- | include/cpuinfo.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/cpuinfo.h b/include/cpuinfo.h index f244ebe..6abe8ab 100644 --- a/include/cpuinfo.h +++ b/include/cpuinfo.h @@ -1020,6 +1020,38 @@ static inline bool cpuinfo_has_x86_avx512_4fmaps(void) { #endif } +static inline bool cpuinfo_has_x86_hle(void) { + #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 + return cpuinfo_isa.hle; + #else + return false; + #endif +} + +static inline bool cpuinfo_has_x86_rtm(void) { + #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 + return cpuinfo_isa.rtm; + #else + return false; + #endif +} + +static inline bool cpuinfo_has_x86_xtest(void) { + #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 + return cpuinfo_isa.xtest; + #else + return false; + #endif +} + +static inline bool cpuinfo_has_x86_mpx(void) { + #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 + return cpuinfo_isa.mpx; + #else + return false; + #endif +} + static inline bool cpuinfo_has_x86_cmov(void) { #if CPUINFO_ARCH_X86_64 return true; |