View Single Post
Old 2020-10-25, 22:52   #2
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

5·1,201 Posts
Default

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