Description
Otherwise LLVM generates terrible code for misaligned loads/stores, as can be seen here: https://rust.godbolt.org/z/ax1bqeeKx
The RISC-V Profiles specification states the following
Even though mandated, misaligned loads and stores might execute extremely slowly. Standard software distributions should assume their existence only for correctness, not for performance.
This footnote is not present in the RVA23 spec, but it's unclear whether it got deprecated or implicitly inherited from the profiles spec.
In practice, we probably can expect that most hardware which declares Zicclsm
support will have "fast" misaligned support implemented in hardware.
As another data point, it looks like Linux also considers that enabled Zicclsm
means "fast" misaligned operations. From this patch:
If Zicclsm is present, the kernel will set both scalar and vector unaligned access speed to FAST.