-
Notifications
You must be signed in to change notification settings - Fork 35
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
Should we have a separate _riscv_misaligned* for scalar/vector? #73
Comments
Related llvm patch llvm/llvm-project#88954 |
I suspect the spacemit K1 (aka x60) core in the banana pi f3 has the same behavior. It's certainly faulting for byte aligned vector loads. I haven't checked its scalar behavior though. |
Related discussions in llvm-project and google/android-riscv |
The task group that maintains this document has a fairly clear policy for adding new My main concern is software portability and fragmentation, and the toolchain burden of supporting a potential proliferation of these macros. I think we should set a high bar on their utility and generality. I think this decision should be made by consensus within a meeting of the task group (or parent committee). |
There is a pending patch to the hwprobe documentation to clarify that it only detects unaligned scalar accesses. https://lore.kernel.org/lkml/tencent_9D721BDDF88C04DBB5151D57711D62524209@qq.com/T/ As far as I understand, hwprobe does its detection by doing an unaligned scalar access and measuring how long it takes. Without proper emulation of vector in SBI, I guess the kernel can't measure unaligned vector time this way. Hopefully, the missing unaligned vector emulation in SBI will come soon. This is needed to support the Zicclsm requirements of RVA23 on CPUs without unaligned vector support. |
GCC is trying to add https://patchwork.sourceware.org/project/gcc/patch/aadc64da-0b0a-4035-89a8-660010da58bd@gmail.com/ |
I created two PR for document, one for -mstrict-align and -mno-strict-align and another one is riscv-non-isa/riscv-toolchain-conventions#49 |
PR to make the existing macros scalar only #80 |
…. Alias -m[no-]strict-align to scalar. __riscv_misaligned_fast will be set based on -mno-scalar-strict-align or -mno-strict-align. This matches the direction gcc is proposing. See riscv-non-isa/riscv-c-api-doc#73 riscv-non-isa/riscv-toolchain-conventions#49 riscv-non-isa/riscv-toolchain-conventions#50 riscv-non-isa/riscv-c-api-doc#80
The LLVM project was recently informed that the CPU used in the Kendryte K230 board supports unaligned scalar accesses in hardware, but unaligned vector accesses will trap. llvm/llvm-project#88029
We should consider splitting the preprocessor define to handle this case.
CC: @nick-knight @kito-cheng @vineetgarc @asb @aswaterman
The text was updated successfully, but these errors were encountered: