aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNelson Chu <nelson.chu@sifive.com>2020-11-20 22:33:11 +0800
committerNelson Chu <nelson.chu@sifive.com>2020-12-01 15:23:02 +0800
commit00d4d1b0a3a4d26c9d741b14e601ed2b86fe39ee (patch)
tree8dfd78b2367272c63ce78996ac12c43c710c4e81 /include
parentdfe92496678a200464e54d80e96a608bfea338b9 (diff)
downloadfsf-binutils-gdb-00d4d1b0a3a4d26c9d741b14e601ed2b86fe39ee.zip
fsf-binutils-gdb-00d4d1b0a3a4d26c9d741b14e601ed2b86fe39ee.tar.gz
fsf-binutils-gdb-00d4d1b0a3a4d26c9d741b14e601ed2b86fe39ee.tar.bz2
RISC-V: Support to add implicit extensions for G.
G is a special case, consider the ISA spec github issue as follows, https://github.com/riscv/riscv-isa-manual/issues/575 My understand is that - i, m, a, f and d extensions are not g's implicit extensions, they are g's expansions. The zifencei is the implicit extension of g, and so is zicsr, since it is implicited by f (or i2p1). However, we add the g with the RISCV_UNKNOWN_VERSION to the subset list, and it will not output to the arch string, it is only used to check what implicit extensions are need to be added. bfd/ * elfxx-riscv.c (riscv_parse_add_subset): Allow to add g with RISCV_UNKNOWN_VERSION versions. (riscv_parse_std_ext): Add g to the subset list, we only use it to add the implicit extensions, but won't output it to arch string. (riscv_parse_add_implicit_subsets): Add implicit zicsr and zifencei for g extension. (riscv_arch_str1): Do not output g to the arch string. * elfxx-riscv.h (RISCV_UNKNOWN_VERSION): Moved to include/opcode/riscv.h. gas/ * testsuite/gas/riscv/attribute-10.d: Updated. * testsuite/gas/riscv/march-imply-g.d: New testcase for g. * testsuite/gas/riscv/march-imply-unsupported.d: The zicsr and zifencei are not supported in the ISA spec v2.2, so don't add and output them. include/ * opcode/riscv.h (RISCV_UNKNOWN_VERSION): added.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog4
-rw-r--r--include/opcode/riscv.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 7cda518..81486ad 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,9 @@
2020-12-01 Nelson Chu <nelson.chu@sifive.com>
+ * opcode/riscv.h (RISCV_UNKNOWN_VERSION): added.
+
+2020-12-01 Nelson Chu <nelson.chu@sifive.com>
+
* opcode/riscv.h (riscv_ext_version):
Change the version type from unsigned to int.
diff --git a/include/opcode/riscv.h b/include/opcode/riscv.h
index 94a1380..680780a 100644
--- a/include/opcode/riscv.h
+++ b/include/opcode/riscv.h
@@ -354,6 +354,8 @@ enum riscv_isa_spec_class
ISA_SPEC_CLASS_20191213
};
+#define RISCV_UNKNOWN_VERSION -1
+
/* This structure holds version information for specific ISA. */
struct riscv_ext_version