View Single Post
Old 2020-10-25, 15:45   #1
Artoria2e5
 
Oct 2020

1 Posts
Lightbulb The correct way for MacOS users to check for CPU instruction sets

The current README has this to say about determining the SIMD build mode on Macs:

Quote:
Mac OS X has no /proc/cpuinfo file, so Mac users will need to [Apple Icon] → About This Mac, then compare the processor type displayed in the resulting dialog box against the following Wikipedia entries:
This actually does not work at all since Apple now only tells you it's a "6-core Intel i7 CPU". The correct way to do it, which does not involve wikipedia, is by querying
one of the following on the terminal:

Code:
$ sysctl hw.optional
hw.optional.floatingpoint: 1
hw.optional.mmx: 1
hw.optional.sse: 1
hw.optional.sse2: 1
hw.optional.sse3: 1
hw.optional.supplementalsse3: 1
hw.optional.sse4_1: 1
hw.optional.sse4_2: 1
hw.optional.x86_64: 1
hw.optional.aes: 1
hw.optional.avx1_0: 1
hw.optional.rdrand: 1
hw.optional.f16c: 1
hw.optional.enfstrg: 1
hw.optional.fma: 1
hw.optional.avx2_0: 1
hw.optional.bmi1: 1
hw.optional.bmi2: 1
hw.optional.rtm: 0
hw.optional.hle: 0
hw.optional.adx: 1
hw.optional.mpx: 0
hw.optional.sgx: 0
hw.optional.avx512f: 0
hw.optional.avx512cd: 0
hw.optional.avx512dq: 0
hw.optional.avx512bw: 0
hw.optional.avx512vl: 0
hw.optional.avx512ifma: 0
hw.optional.avx512vbmi: 0
$ sysctl machdep.cpu.features
FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX SMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C
As I understand, the former is the BSD way of describing stuff, while the latter is specific to Mac OS/Darwin.

Please update the README.
Artoria2e5 is offline   Reply With Quote