![]() |
![]() |
#1 | |
Oct 2020
1 Posts |
![]()
The current README has this to say about determining the SIMD build mode on Macs:
Quote:
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 Please update the README. |
|
![]() |
![]() |
![]() |
#2 |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
2×34×37 Posts |
![]()
IMO the only true-and-correctTM method of finding out what one's system can execute is to simply execute an instruction from the set. If you get an exception then you can't use that set.
This it because it isn't just the CPU you are testing for, it is also the OS. If the OS doesn't enable, and support the instruction set you want to use, even if the CPU has it, then you won't be able to execute them. If you get no exception thrown then you are good to go. And it generalises to all OSes and systems out there. No need to find special files and parse text outputs and whatnot. |
![]() |
![]() |
![]() |
#3 | |
"Mark"
Apr 2003
Between here and the
616310 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#4 | |
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
28·41 Posts |
![]() Quote:
Can you give a specific example of an instruction which is supported by the bare metal but which can not be executed because of a restriction imposed by the overlying OS? This is a genuine question because I have never come across an example before. |
|
![]() |
![]() |
![]() |
#5 | |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
599410 Posts |
![]() Quote:
The AVX instructions that use ZMM registers, for example, must be enabled by the OS before anyone can use them. I believe this is because the FXSAVE/FXRESTORE type instructions have a different format for the extra registers. So if the OS is unaware of how, or unwilling, to enable such instructions, then the applications also can't use them. |
|
![]() |
![]() |
![]() |
#6 | |
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
101001000000002 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#7 |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
599410 Posts |
![]()
If the instruction is not supported then you get an exception. You can test it with an older OS not aware of AVX and try executing some AVX instructions on a newer CPU.
|
![]() |
![]() |
![]() |
#8 | ||
∂2ω=0
Sep 2002
RepΓΊblica de California
22·3·5·193 Posts |
![]() Quote:
Quote:
Anyhow, the OP-post stuff is all about quickly getting a builder/user to "which instructions should be supported on my CPU?", building with the associated inline-asm selected, then seeing if the resulting binary runs properly. |
||
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
is it possible to run Prime95 on MacOS? | dash1729 | Software | 3 | 2020-08-19 20:30 |
Covering sets for a^n-1 | carpetpool | Abstract Algebra & Algebraic Number Theory | 1 | 2017-12-28 12:48 |
sets of 3 primes | MattcAnderson | Miscellaneous Math | 3 | 2017-10-18 00:24 |
Covering sets | robert44444uk | Computer Science & Computational Number Theory | 15 | 2017-01-04 12:39 |
Julia Sets | mfgoode | Miscellaneous Math | 2 | 2006-04-04 00:18 |