Apple - Use OSX terminal to find out the CPU instructions set (AVX, SSE and such)

Enter

sysctl -a | grep cpu.feat

get a list like

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 EST TM2 SSSE3 CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC POPCNT AES PCID XSAVE OSXSAVE TSCTMR AVX1.0
machdep.cpu.feature_bits: 2286390173542120447

Alternatively (avoiding the grep and being a lot faster, which might help you run this often within a script)

sysctl machdep.cpu.features
sysctl machdep.cpu.features machdep.cpu.feature_bits

gives you just the list (or both) directly.

Or just use: sysctl machdep.cpu to get them all


Just to extend LangLangC's answer, for some reason, AVX2 does not appear in the machdep.cpu.features list but in a separate list: machdep.cpu.leaf7_features. To check all supported flags you can use:

/usr/sbin/sysctl -n machdep.cpu.features machdep.cpu.leaf7_features

Resulting in an output like

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
RDWRFSGS TSC_THREAD_OFFSET SGX BMI1 HLE AVX2 SMEP BMI2 ERMS INVPCID RTM FPU_CSDS MPX RDSEED ADX SMAP CLFSOPT IPT MDCLEAR TSXFA IBRS STIBP L1DF SSBD

Tags:

Terminal