aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2023-12-19 18:38:52 +0900
committerMITSUNARI Shigeo <[email protected]>2023-12-19 18:38:55 +0900
commitba943b5b662caf729da3e741a797e2aa3a4f4677 (patch)
tree01b4cfbc282c32c71b10a8ceda18def8efe0d336
parent30c362df53e691ff13830dee61867844d81d700f (diff)
downloadxbyak-ba943b5b662caf729da3e741a797e2aa3a4f4677.tar.gz
xbyak-ba943b5b662caf729da3e741a797e2aa3a4f4677.zip
reorder cpu detection
-rw-r--r--xbyak/xbyak_util.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/xbyak/xbyak_util.h b/xbyak/xbyak_util.h
index b49f0f8..afe536a 100644
--- a/xbyak/xbyak_util.h
+++ b/xbyak/xbyak_util.h
@@ -525,14 +525,14 @@ public:
if (maxExtendedNum >= 0x80000001) {
getCpuid(0x80000001, data);
- if (EDX & (1U << 31)) type_ |= t3DN;
- if (EDX & (1U << 30)) type_ |= tE3DN;
- if (EDX & (1U << 27)) type_ |= tRDTSCP;
- if (EDX & (1U << 22)) type_ |= tMMX2;
- if (EDX & (1U << 15)) type_ |= tCMOV;
if (ECX & (1U << 5)) type_ |= tLZCNT;
- if (ECX & (1U << 8)) type_ |= tPREFETCHW;
if (ECX & (1U << 6)) type_ |= tSSE4a;
+ if (ECX & (1U << 8)) type_ |= tPREFETCHW;
+ if (EDX & (1U << 15)) type_ |= tCMOV;
+ if (EDX & (1U << 22)) type_ |= tMMX2;
+ if (EDX & (1U << 27)) type_ |= tRDTSCP;
+ if (EDX & (1U << 30)) type_ |= tE3DN;
+ if (EDX & (1U << 31)) type_ |= t3DN;
}
if (maxExtendedNum >= 0x80000008) {
@@ -551,8 +551,8 @@ public:
if (ECX & (1U << 25)) type_ |= tAESNI;
if (ECX & (1U << 26)) type_ |= tXSAVE;
if (ECX & (1U << 27)) type_ |= tOSXSAVE;
- if (ECX & (1U << 30)) type_ |= tRDRAND;
if (ECX & (1U << 29)) type_ |= tF16C;
+ if (ECX & (1U << 30)) type_ |= tRDRAND;
if (EDX & (1U << 15)) type_ |= tCMOV;
if (EDX & (1U << 23)) type_ |= tMMX;
@@ -563,8 +563,8 @@ public:
// check XFEATURE_ENABLED_MASK[2:1] = '11b'
uint64_t bv = getXfeature();
if ((bv & 6) == 6) {
- if (ECX & (1U << 28)) type_ |= tAVX;
if (ECX & (1U << 12)) type_ |= tFMA;
+ if (ECX & (1U << 28)) type_ |= tAVX;
// do *not* check AVX-512 state on macOS because it has on-demand AVX-512 support
#if !defined(__APPLE__)
if (((bv >> 5) & 7) == 7)
@@ -598,16 +598,16 @@ public:
const uint32_t maxNumSubLeaves = EAX;
if (type_ & tAVX && (EBX & (1U << 5))) type_ |= tAVX2;
if (EBX & (1U << 3)) type_ |= tBMI1;
+ if (EBX & (1U << 4)) type_ |= tHLE;
if (EBX & (1U << 8)) type_ |= tBMI2;
if (EBX & (1U << 9)) type_ |= tENHANCED_REP;
+ if (EBX & (1U << 11)) type_ |= tRTM;
+ if (EBX & (1U << 14)) type_ |= tMPX;
if (EBX & (1U << 18)) type_ |= tRDSEED;
if (EBX & (1U << 19)) type_ |= tADX;
if (EBX & (1U << 20)) type_ |= tSMAP;
if (EBX & (1U << 23)) type_ |= tCLFLUSHOPT;
if (EBX & (1U << 24)) type_ |= tCLWB;
- if (EBX & (1U << 4)) type_ |= tHLE;
- if (EBX & (1U << 11)) type_ |= tRTM;
- if (EBX & (1U << 14)) type_ |= tMPX;
if (EBX & (1U << 29)) type_ |= tSHA;
if (ECX & (1U << 0)) type_ |= tPREFETCHWT1;
if (ECX & (1U << 5)) type_ |= tWAITPKG;