]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Add the Zihpm and Zicntr extensions
authorPalmer Dabbelt <palmer@rivosinc.com>
Wed, 9 Nov 2022 03:00:36 +0000 (19:00 -0800)
committerKito Cheng <kito.cheng@sifive.com>
Fri, 19 Jan 2024 08:02:51 +0000 (16:02 +0800)
These extensions were recently frozen [1].  As per Andrew's post [2]
we're meant to ignore these in software, this just adds them to the list
of allowed extensions and otherwise ignores them.  I added these under
SPEC_CLASS_NONE even though the PDF lists them as 20190614 because it
seems pointless to add another spec class just to accept two extensions
we then ignore.

1: https://groups.google.com/a/groups.riscv.org/g/isa-dev/c/HZGoqP1eyps/m/GTNKRLJoAQAJ
2: https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/QKjQhChrq9Q/m/7gqdkctgAgAJ

gcc/ChangeLog

* common/config/riscv/riscv-common.cc: Add Zihpm and Zicnttr
extensions.

gcc/common/config/riscv/riscv-common.cc

index 958a6925a6d5aa11d8d8f7add89048d04d34c3be..4da7f37303b20c0754373c5c63a343b8da79ecc5 100644 (file)
@@ -279,6 +279,9 @@ static const struct riscv_ext_version riscv_ext_version_table[] =
   {"zicbom",ISA_SPEC_CLASS_NONE, 1, 0},
   {"zicbop",ISA_SPEC_CLASS_NONE, 1, 0},
 
+  {"zicntr", ISA_SPEC_CLASS_NONE, 2, 0},
+  {"zihpm",  ISA_SPEC_CLASS_NONE, 2, 0},
+
   {"zk",    ISA_SPEC_CLASS_NONE, 1, 0},
   {"zkn",   ISA_SPEC_CLASS_NONE, 1, 0},
   {"zks",   ISA_SPEC_CLASS_NONE, 1, 0},