Question: Is the method is_available correct? #177
-
|
I'm using part of your code to implement one of my libraries. And I have a question about the method If I compile with avx2 support and run it on a processor without the avx2 flag, wouldn't that result in a SIGILL, illegal instruction? I don't understand, shouldn't I check it at runtime? Forgive my ignorance, could you explain a little? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
It is checked at runtime: memchr/src/arch/x86_64/avx2/memchr.rs Line 101 in ceef3c9 The runtime check is only done when it isn't known whether |
Beta Was this translation helpful? Give feedback.
It is checked at runtime:
memchr/src/arch/x86_64/avx2/memchr.rs
Line 101 in ceef3c9
The runtime check is only done when it isn't known whether
avx2is enabled at compile time. If it is enabled at compile time, then there's no reason to do the check at runtime.