View Single Post
Old 2020-10-27, 19:27   #8
ewmayer's Avatar
Sep 2002
Rep├║blica de California

22×3×5×193 Posts

Originally Posted by Artoria2e5 View Post
The current README has this to say about determining the SIMD build mode on Macs:

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:

$ sysctl hw.optional
A good suggestion, thanks. The README has been updated.
Originally Posted by retina View Post
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.
...and the compiler and assembler one is using under said OS. IIRC when George was first beginning to play with the then-new avx-512 instruction set, he found that MASM had no support for it. I had no such trouble with the latest stable version of gcc/as under Linux of the "GIMPS KNL", but found that the accompanying version of gdb did not properly support display of the avx-512 registers, so we needed to go to a newer unstable-branch gdb.

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.
ewmayer is offline   Reply With Quote