rurban / smhasher

Hash function quality and speed tests
https://rurban.github.io/smhasher/
Other
1.82k stars 177 forks source link

CPU feature detection #10

Open sh1boot opened 8 years ago

sh1boot commented 8 years ago

Could I suggest parsing gcc -march=native -dM -E - <<< '' rather than /proc/cpuinfo? It'll be implicitly filtered to whatever the current compiler can handle; which helps for old compilers, but also captures features that appear in the future with less rework to the parser.

This makes it easier to work with cross compilers because the command will return a tangible error, and then it can fail over to $CC $CFLAGS -dM -E - <<< '' and those variables can be set as needed to choose the required hardware features.

I think this might also be a better way to handle ABIs like x32 (and others), which have a 32-bit pointer but native 64-bit arithmetic.

rurban commented 8 years ago

Agreed

mirh commented 4 years ago

And it would also greatly help to just have the compiler to bang one's head against, rather than that and cmake (while I was trying to solve my other reported problem).

rurban commented 4 years ago

Now that we support cross-compilation, this should be really improved. I really want to test on my phones.