aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-riscv.c18
-rw-r--r--gas/testsuite/gas/riscv/extended/sifive-insns.d12
-rw-r--r--gas/testsuite/gas/riscv/extended/sifive-insns.s4
3 files changed, 33 insertions, 1 deletions
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index 99165f5..8e28adb7 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -40,6 +40,7 @@ enum
{
DRAFT_EXT = 0,
VENDOR_THEAD_EXT,
+ VENDOR_SIFIVE_EXT,
EXTENDED_EXT_NUM
};
@@ -310,6 +311,13 @@ riscv_extended_subset_supports (int insn_class)
case INSN_CLASS_THEADSE:
return riscv_subset_supports ("xtheadse");
+ case INSN_CLASS_XSF_CDISCARDDLONE:
+ return riscv_subset_supports ("xsfcdiscarddlone");
+ case INSN_CLASS_XSF_CFLUSHDLONE:
+ return riscv_subset_supports ("xsfcflushdlone");
+ case INSN_CLASS_XSF_CFLUSHILONE:
+ return riscv_subset_supports ("xsfcflushilone");
+
default:
as_fatal ("internal: unknown INSN_CLASS (0x%x)", insn_class);
return false;
@@ -461,6 +469,9 @@ static htab_t op_draft_hash = NULL;
/* Handle of the T-HEAD OPCODE hash table. */
static htab_t op_vendor_thead_hash = NULL;
+/* Handle of the sifive OPCODE hash table. */
+static htab_t op_vendor_sifive_hash = NULL;
+
/* Handle of the type of .insn hash table. */
static htab_t insn_type_hash = NULL;
@@ -1481,7 +1492,10 @@ md_begin (void)
hash_reg_names (RCLASS_VECR, riscv_vecr_names_numeric, NVECR);
hash_reg_names (RCLASS_VECM, riscv_vecm_names_numeric, NVECM);
op_draft_hash = init_opcode_hash (riscv_extended_opcodes[DRAFT_EXT], false);
- op_vendor_thead_hash = init_opcode_hash (riscv_extended_opcodes[VENDOR_THEAD_EXT], false);
+ op_vendor_thead_hash =
+ init_opcode_hash (riscv_extended_opcodes[VENDOR_THEAD_EXT], false);
+ op_vendor_sifive_hash =
+ init_opcode_hash (riscv_extended_opcodes[VENDOR_SIFIVE_EXT], false);
}
static insn_t
@@ -1593,6 +1607,8 @@ riscv_find_extended_opcode_hash (char *str ATTRIBUTE_UNUSED)
case VENDOR_THEAD_EXT:
insn = (struct riscv_opcode *) str_hash_find (op_vendor_thead_hash, str);
break;
+ case VENDOR_SIFIVE_EXT:
+ insn = (struct riscv_opcode *) str_hash_find (op_vendor_sifive_hash, str);
default:
break;
}
diff --git a/gas/testsuite/gas/riscv/extended/sifive-insns.d b/gas/testsuite/gas/riscv/extended/sifive-insns.d
new file mode 100644
index 0000000..ea6377a
--- /dev/null
+++ b/gas/testsuite/gas/riscv/extended/sifive-insns.d
@@ -0,0 +1,12 @@
+#as: -march=rv32i_xsfcdiscarddlone_xsfcflushdlone_xsfcflushilone
+#objdump: -dr
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ ]+0:[ ]+fc050073[ ]+cflush.d.l1[ ]+a0
+[ ]+4:[ ]+fc250073[ ]+cdiscard.d.l1[ ]+a0
+[ ]+8:[ ]+fc100073[ ]+cflush.i.l1
diff --git a/gas/testsuite/gas/riscv/extended/sifive-insns.s b/gas/testsuite/gas/riscv/extended/sifive-insns.s
new file mode 100644
index 0000000..b44dad0
--- /dev/null
+++ b/gas/testsuite/gas/riscv/extended/sifive-insns.s
@@ -0,0 +1,4 @@
+target:
+ cflush.d.l1 x10
+ cdiscard.d.l1 x10
+ cflush.i.l1