From: Tsukasa OI <research_trasio@irq.a4lg.com>
Because the author is going to reorganize core RISC-V disassembler, we have
to make sure that nothing is broken when disassembling with mapping symbols
with ISA string.
This commit adds a testcase for 'F' and 'Zfinx' instructions to make sure
that "FPR" register names are correctly switched when necessary.
gas/ChangeLog:
* testsuite/gas/riscv/mapping.s: Add 'F' and 'Zfinx' testcase.
* testsuite/gas/riscv/mapping-dis.d: Likewise.
* testsuite/gas/riscv/mapping-symbols.d: Likewise.
---
gas/testsuite/gas/riscv/mapping-dis.d | 7 +++++++
gas/testsuite/gas/riscv/mapping-symbols.d | 4 ++++
gas/testsuite/gas/riscv/mapping.s | 10 ++++++++++
3 files changed, 21 insertions(+)
@@ -91,3 +91,10 @@ Disassembly of section .text.relax.align:
[ ]+[0-9a-f]+:[ ]+00000013[ ]+nop
[ ]+[0-9a-f]+:[ ]+00200513[ ]+li[ ]+a0,2
[ ]+[0-9a-f]+:[ ]+00000013[ ]+nop
+
+Disassembly of section .text.dis.zfinx:
+
+0+000 <.text.dis.zfinx>:
+[ ]+[0-9a-f]+:[ ]+00c5f553[ ]+fadd\.s[ ]+fa0,fa1,fa2
+[ ]+[0-9a-f]+:[ ]+00c5f553[ ]+fadd\.s[ ]+a0,a1,a2
+[ ]+[0-9a-f]+:[ ]+00c5f553[ ]+fadd\.s[ ]+fa0,fa1,fa2
@@ -42,6 +42,10 @@ SYMBOL TABLE:
0+00 l d .text.relax.align 0+00 .text.relax.align
0+00 l .text.relax.align 0+00 \$xrv32i2p1_c2p0
0+08 l .text.relax.align 0+00 \$xrv32i2p1
+0+00 l d .text.dis.zfinx 0+00 .text.dis.zfinx
+0+00 l .text.dis.zfinx 0+00 \$xrv32i2p1_f2p2_zicsr2p0
+0+04 l .text.dis.zfinx 0+00 \$xrv32i2p1_zicsr2p0_zfinx1p0
+0+08 l .text.dis.zfinx 0+00 \$xrv32i2p1_f2p2_zicsr2p0
0+0a l .text.section.padding 0+00 \$x
0+03 l .text.odd.align.start.insn 0+00 \$d
0+04 l .text.odd.align.start.insn 0+00 \$x
@@ -119,3 +119,13 @@ addi a0, zero, 1 # $x, won't added
.align 3 # $x, won't added
addi a0, zero, 2 # $xrv32i
.option pop
+
+.section .text.dis.zfinx, "ax"
+.option push
+.option arch, rv32if
+fadd.s fa0, fa1, fa2 # $xrv32if
+.option arch, rv32i_zfinx
+fadd.s a0, a1, a2 # $xrv32i_zfinx
+.option arch, rv32if
+fadd.s fa0, fa1, fa2 # $xrv32if
+.option pop