New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARM64 SVE
target failed tests
#1799
Comments
Thanks for reporting the issue. Looks like AES related tests, and the NEON target indeed includes AES instructions. I see from the A64FX microarchitecture guide that AESD/AESE etc are supported. Are you able to run with |
(do you need the asm of the whole function?) |
Thanks for confirming. Interesting, it does seem to be an AES instruction that is faulting. |
Actually, it doesn't support AES instructions, to my surprise! These are the flags reported in |
Interesting, thanks for confirming. Indeed we are detecting that the CPU supports AES, according to the OS, via this code in targets.cc:
Can you confirm via printf or abort that this If so, it's very curious that getauxval would be incorrect. Our code seems to match an example. Are there any other flags we could check to detect this properly on your system? |
I'm sorry, I think I don't know how to do that. I modified the code you mentioned with
and run |
Thanks for adding the printfs! I see that we only add HWY_NEON to HWY_BASELINE_NEON if the compiler sets __ARM_FEATURE_AES, which looks correct. As to why the printf is skipped: we are compiling with clang, but the runtime dispatch is only known to work with (and thus enabled for) GCC. If !HWY_HAVE_RUNTIME_DISPATCH [1], then we assume the presence of all CPU features enabled by compiler flags instead of detecting. This is risky but reasonable because the compiler could also be generating those instructions, and if they weren't supported by the CPU, the binary would crash anyway. But it seems that your -mcpu sets __ARM_FEATURE_AES, which might be a misunderstanding; I think that's NEON AES, which your CPU indeed does not support. To work around this, we could still run the CPU feature detection, and thus skip the HWY_NEON target which requires AES. 1: The prereqs for HWY_HAVE_RUNTIME_DISPATCH are |
Hello again, sorry for the delay.
These are the ARM-related flags obtained from
I changed the one on line 456 (hope it's what you meant). And it outputs this:
So I tried to also change the one on line 333 to
I'm still working with clang 16.0.6. I also made some quick attempts with gcc 11.1.0 but there were some compilation errors. Hope this helps |
A quick update, we are getting close to enabling runtime dispatch for aarch64+clang, which would fix that. Per the output you provided above, we are correctly detecting that the system somehow does not support AES, even though the CPU should. That should prevent the SIGILL crash. |
Hello,
I compiled Highway 1.0.7 on a Fujitsu A64FX and these tests failed.
I configured Highway with these flags with cmake 3.26.3:
When compiling (with clang 16.0.6), these are the detected targets:
The text was updated successfully, but these errors were encountered: