This series adds a way to fix errata for specific cores, and adds the
first erratum.

Patch 1 adds the framework, with no errata yet:

- riscv-errata.def lists the errata.  Each one has a -mfix-NAME option.
- RISCV_CORE_ERRATUM in riscv-cores.def lists the errata of a core.
- --with-errata=LIST turns on workarounds by default.

Patch 2 adds -mfix-sifive-mal-9174, which is on by default for
sifive-p870-d.  It keeps the destination of a vector indexed load from
overlapping its index.  The code does not change when it is off.

I plan to backport this series to GCC 16.

Tested with QEMU and our p870 bigsky board.

Kito Cheng (2):
  RISC-V: Add per-CPU errata framework
  RISC-V: Work around SiFive erratum MAL-9174

 gcc/config.gcc                                | 19 +++++
 gcc/config/riscv/riscv-cores.def              | 15 +++-
 gcc/config/riscv/riscv-errata.def             | 35 +++++++++
 gcc/config/riscv/riscv-opts.h                 | 13 ++++
 gcc/config/riscv/riscv.cc                     | 71 +++++++++++++++++++
 gcc/config/riscv/riscv.h                      |  1 +
 gcc/config/riscv/riscv.md                     |  9 +++
 gcc/config/riscv/riscv.opt                    |  4 ++
 gcc/config/riscv/vector.md                    | 34 +++++----
 gcc/doc/install.texi                          | 12 ++++
 gcc/doc/invoke.texi                           | 20 ++++++
 .../riscv/rvv/base/sifive-mal-9174-1.c        | 46 ++++++++++++
 .../riscv/rvv/base/sifive-mal-9174-2.c        | 46 ++++++++++++
 .../riscv/rvv/base/sifive-mal-9174-3.c        | 46 ++++++++++++
 .../riscv/rvv/base/sifive-mal-9174-4.c        | 46 ++++++++++++
 15 files changed, 402 insertions(+), 15 deletions(-)
 create mode 100644 gcc/config/riscv/riscv-errata.def
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/sifive-mal-9174-1.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/sifive-mal-9174-2.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/sifive-mal-9174-3.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/sifive-mal-9174-4.c


base-commit: 08f84a62a4cf141bbe391ff8c670ac16c99b1f42
-- 
2.54.0

Reply via email to