diff options
author | Tsukasa OI <research_trasio@irq.a4lg.com> | 2022-01-11 19:14:02 +0900 |
---|---|---|
committer | Nelson Chu <nelson.chu@sifive.com> | 2022-03-18 15:32:22 +0800 |
commit | 41d6ac5da655a2e78109848f2db47e53552fd61a (patch) | |
tree | 2d6c789b0169492700e80edbde84342c9c4bb68c /gas | |
parent | 3b374308d3006407b9571e573e4ccce4e904a4c4 (diff) | |
download | gdb-41d6ac5da655a2e78109848f2db47e53552fd61a.zip gdb-41d6ac5da655a2e78109848f2db47e53552fd61a.tar.gz gdb-41d6ac5da655a2e78109848f2db47e53552fd61a.tar.bz2 |
RISC-V: Cache management instructions
This commit adds 'Zicbom' / 'Zicboz' instructions.
bfd/ChangeLog:
* elfxx-riscv.c (riscv_multi_subset_supports): Add handling for
new instruction classes.
include/ChangeLog:
* opcode/riscv-opc.h (MATCH_CBO_CLEAN, MASK_CBO_CLEAN,
MATCH_CBO_FLUSH, MASK_CBO_FLUSH, MATCH_CBO_INVAL,
MASK_CBO_INVAL, MATCH_CBO_ZERO, MASK_CBO_ZERO): New macros.
* opcode/riscv.h (enum riscv_insn_class): Add new instruction
classes INSN_CLASS_ZICBOM and INSN_CLASS_ZICBOZ.
opcodes/ChangeLog:
* riscv-opc.c (riscv_opcodes): Add cache-block management
instructions.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/gas/riscv/zicbom-fail.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/zicbom-fail.l | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/zicbom-fail.s | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/zicbom.d | 15 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/zicbom.s | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/zicboz-fail.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/zicboz-fail.l | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/zicboz-fail.s | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/zicboz.d | 13 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/zicboz.s | 5 |
10 files changed, 70 insertions, 0 deletions
diff --git a/gas/testsuite/gas/riscv/zicbom-fail.d b/gas/testsuite/gas/riscv/zicbom-fail.d new file mode 100644 index 0000000..a6a61df --- /dev/null +++ b/gas/testsuite/gas/riscv/zicbom-fail.d @@ -0,0 +1,3 @@ +#as: -march=rv64g_zicbom +#source: zicbom-fail.s +#error_output: zicbom-fail.l diff --git a/gas/testsuite/gas/riscv/zicbom-fail.l b/gas/testsuite/gas/riscv/zicbom-fail.l new file mode 100644 index 0000000..2cf7635 --- /dev/null +++ b/gas/testsuite/gas/riscv/zicbom-fail.l @@ -0,0 +1,7 @@ +.*: Assembler messages: +.*: Error: illegal operands `cbo.clean 1\(x1\)' +.*: Error: illegal operands `cbo.clean x30' +.*: Error: illegal operands `cbo.flush \(0\+1\)\(x1\)' +.*: Error: illegal operands `cbo.flush x30' +.*: Error: illegal operands `cbo.inval 3\*2\+5\(x1\)' +.*: Error: illegal operands `cbo.inval x30' diff --git a/gas/testsuite/gas/riscv/zicbom-fail.s b/gas/testsuite/gas/riscv/zicbom-fail.s new file mode 100644 index 0000000..5fa2274 --- /dev/null +++ b/gas/testsuite/gas/riscv/zicbom-fail.s @@ -0,0 +1,7 @@ +target: + cbo.clean 1(x1) + cbo.clean x30 + cbo.flush (0+1)(x1) + cbo.flush x30 + cbo.inval 3*2+5(x1) + cbo.inval x30 diff --git a/gas/testsuite/gas/riscv/zicbom.d b/gas/testsuite/gas/riscv/zicbom.d new file mode 100644 index 0000000..edd8a70 --- /dev/null +++ b/gas/testsuite/gas/riscv/zicbom.d @@ -0,0 +1,15 @@ +#as: -march=rv64g_zicbom +#source: zicbom.s +#objdump: -dr + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 <target>: +[ ]+[0-9a-f]+:[ ]+0010a00f[ ]+cbo\.clean[ ]+\(ra\) +[ ]+[0-9a-f]+:[ ]+001f200f[ ]+cbo\.clean[ ]+\(t5\) +[ ]+[0-9a-f]+:[ ]+0020a00f[ ]+cbo\.flush[ ]+\(ra\) +[ ]+[0-9a-f]+:[ ]+002f200f[ ]+cbo\.flush[ ]+\(t5\) +[ ]+[0-9a-f]+:[ ]+0000a00f[ ]+cbo\.inval[ ]+\(ra\) +[ ]+[0-9a-f]+:[ ]+000f200f[ ]+cbo\.inval[ ]+\(t5\) diff --git a/gas/testsuite/gas/riscv/zicbom.s b/gas/testsuite/gas/riscv/zicbom.s new file mode 100644 index 0000000..6a306b9 --- /dev/null +++ b/gas/testsuite/gas/riscv/zicbom.s @@ -0,0 +1,7 @@ +target: + cbo.clean (x1) + cbo.clean 0(x30) + cbo.flush (x1) + cbo.flush (2-2)(x30) + cbo.inval (x1) + cbo.inval 3*4-12(x30) diff --git a/gas/testsuite/gas/riscv/zicboz-fail.d b/gas/testsuite/gas/riscv/zicboz-fail.d new file mode 100644 index 0000000..74cfd2f --- /dev/null +++ b/gas/testsuite/gas/riscv/zicboz-fail.d @@ -0,0 +1,3 @@ +#as: -march=rv64g_zicboz +#source: zicboz-fail.s +#error_output: zicboz-fail.l diff --git a/gas/testsuite/gas/riscv/zicboz-fail.l b/gas/testsuite/gas/riscv/zicboz-fail.l new file mode 100644 index 0000000..ad8dcf5 --- /dev/null +++ b/gas/testsuite/gas/riscv/zicboz-fail.l @@ -0,0 +1,5 @@ +.*: Assembler messages: +.*: Error: illegal operands `cbo.zero x1' +.*: Error: illegal operands `cbo.zero 1\(x30\)' +.*: Error: illegal operands `cbo.zero 3\+5\(x1\)' +.*: Error: illegal operands `cbo.zero \(2\*4\)\(x30\)' diff --git a/gas/testsuite/gas/riscv/zicboz-fail.s b/gas/testsuite/gas/riscv/zicboz-fail.s new file mode 100644 index 0000000..0856ea8 --- /dev/null +++ b/gas/testsuite/gas/riscv/zicboz-fail.s @@ -0,0 +1,5 @@ +target: + cbo.zero x1 + cbo.zero 1(x30) + cbo.zero 3+5(x1) + cbo.zero (2*4)(x30) diff --git a/gas/testsuite/gas/riscv/zicboz.d b/gas/testsuite/gas/riscv/zicboz.d new file mode 100644 index 0000000..e04ab34 --- /dev/null +++ b/gas/testsuite/gas/riscv/zicboz.d @@ -0,0 +1,13 @@ +#as: -march=rv64g_zicboz +#source: zicboz.s +#objdump: -dr + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 <target>: +[ ]+[0-9a-f]+:[ ]+0040a00f[ ]+cbo\.zero[ ]+\(ra\) +[ ]+[0-9a-f]+:[ ]+004f200f[ ]+cbo\.zero[ ]+\(t5\) +[ ]+[0-9a-f]+:[ ]+0040a00f[ ]+cbo\.zero[ ]+\(ra\) +[ ]+[0-9a-f]+:[ ]+004f200f[ ]+cbo\.zero[ ]+\(t5\) diff --git a/gas/testsuite/gas/riscv/zicboz.s b/gas/testsuite/gas/riscv/zicboz.s new file mode 100644 index 0000000..3830362 --- /dev/null +++ b/gas/testsuite/gas/riscv/zicboz.s @@ -0,0 +1,5 @@ +target: + cbo.zero 0(x1) + cbo.zero (x30) + cbo.zero 2-2(x1) + cbo.zero (3*5-15)(x30) |