llvm-project
a464c446 - [RISCV] Add command line options to disable register overlap for vector indexed load for SiFive erratum (#224739)

Commit
7 hours ago
[RISCV] Add command line options to disable register overlap for vector indexed load for SiFive erratum (#224739) If a trap occurs on an element other than 0, some SiFive cores will write a garbage value to that element and all active elements after it in the destination register before running the trap handler. This is normally allowed by the spec if restarting the instruction would overwrite the elements with the correct results. For a vector indexed load with overlapping source and destination, writing the later elements with garbage corrupts some of the source indices. This prevents the instruction from restarting correctly once the fault has been handled. This patch adds two options, `-m[no-]fix-sifive-mal-9174` and `-m[no-]fix-sifive-mal-9191`, that allows users to opt out of overlapping registers on these instructions. This gcc patch https://gcc.gnu.org/pipermail/gcc-patches/2026-November/737556.html will be updated to use the same names. mal-9174 and mal-9191 are the names from our internal bug database. The option is enabled by default on SiFive P870-D. Assisted-by: Claude
Author
Parents
Loading