From 7722d40a9c412d26c30db8af5005b36de5618737 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 12 Nov 2019 16:13:00 -0800 Subject: RISC-V: Support the INSN_CLASS.*F.* classes for .insn directive. We have to enable the f extension through -march or ELF attribute if we use the FPR in .insn directive. The behavior is same as the riscv_opcodes. 2019-11-12 Nelson Chu opcodes/ * riscv-opc.c (riscv_insn_types): Replace the INSN_CLASS_I with INSN_CLASS_F and the INSN_CLASS_C with INSN_CLASS_F_AND_C if we use the floating point register (FPR). gas/ * testsuite/gas/riscv/insn.d: Add the f extension to -march option. Change-Id: I4f59d04c82673ef84c56ecd2659ad8ce164dd626 --- opcodes/ChangeLog | 6 +++ opcodes/riscv-opc.c | 120 ++++++++++++++++++++++++++-------------------------- 2 files changed, 66 insertions(+), 60 deletions(-) (limited to 'opcodes') diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 62b05628159..c6ba9de3df7 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2019-11-12 Nelson Chu + + * riscv-opc.c (riscv_insn_types): Replace the INSN_CLASS_I with + INSN_CLASS_F and the INSN_CLASS_C with INSN_CLASS_F_AND_C if we + use the floating point register (FPR). + 2019-11-12 Mihail Ionescu * opcodes/arm-dis.c (mve_opcodes): Enable VMOV imm to vec with diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c index 06c752a96d5..dbbf99c74fe 100644 --- a/opcodes/riscv-opc.c +++ b/opcodes/riscv-opc.c @@ -787,96 +787,96 @@ const struct riscv_opcode riscv_insn_types[] = { /* name, xlen, isa, operands, match, mask, match_func, pinfo. */ {"r", 0, INSN_CLASS_I, "O4,F3,F7,d,s,t", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F7,D,s,t", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F7,d,S,t", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F7,D,S,t", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F7,d,s,T", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F7,D,s,T", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F7,d,S,T", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F7,D,S,T", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F7,D,s,t", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F7,d,S,t", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F7,D,S,t", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F7,d,s,T", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F7,D,s,T", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F7,d,S,T", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F7,D,S,T", 0, 0, match_opcode, 0 }, {"r", 0, INSN_CLASS_I, "O4,F3,F2,d,s,t,r", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,D,s,t,r", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,d,S,t,r", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,D,S,t,r", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,d,s,T,r", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,D,s,T,r", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,d,S,T,r", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,D,S,T,r", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,d,s,t,R", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,D,s,t,R", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,d,S,t,R", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,D,S,t,R", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,d,s,T,R", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,D,s,T,R", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,d,S,T,R", 0, 0, match_opcode, 0 }, -{"r", 0, INSN_CLASS_I, "O4,F3,F2,D,S,T,R", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,D,s,t,r", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,d,S,t,r", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,D,S,t,r", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,d,s,T,r", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,D,s,T,r", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,d,S,T,r", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,D,S,T,r", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,d,s,t,R", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,D,s,t,R", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,d,S,t,R", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,D,S,t,R", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,d,s,T,R", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,D,s,T,R", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,d,S,T,R", 0, 0, match_opcode, 0 }, +{"r", 0, INSN_CLASS_F, "O4,F3,F2,D,S,T,R", 0, 0, match_opcode, 0 }, {"r4", 0, INSN_CLASS_I, "O4,F3,F2,d,s,t,r", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,D,s,t,r", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,d,S,t,r", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,D,S,t,r", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,d,s,T,r", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,D,s,T,r", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,d,S,T,r", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,D,S,T,r", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,d,s,t,R", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,D,s,t,R", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,d,S,t,R", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,D,S,t,R", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,d,s,T,R", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,D,s,T,R", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,d,S,T,R", 0, 0, match_opcode, 0 }, -{"r4", 0, INSN_CLASS_I, "O4,F3,F2,D,S,T,R", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,D,s,t,r", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,d,S,t,r", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,D,S,t,r", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,d,s,T,r", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,D,s,T,r", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,d,S,T,r", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,D,S,T,r", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,d,s,t,R", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,D,s,t,R", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,d,S,t,R", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,D,S,t,R", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,d,s,T,R", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,D,s,T,R", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,d,S,T,R", 0, 0, match_opcode, 0 }, +{"r4", 0, INSN_CLASS_F, "O4,F3,F2,D,S,T,R", 0, 0, match_opcode, 0 }, {"i", 0, INSN_CLASS_I, "O4,F3,d,s,j", 0, 0, match_opcode, 0 }, -{"i", 0, INSN_CLASS_I, "O4,F3,D,s,j", 0, 0, match_opcode, 0 }, -{"i", 0, INSN_CLASS_I, "O4,F3,d,S,j", 0, 0, match_opcode, 0 }, -{"i", 0, INSN_CLASS_I, "O4,F3,D,S,j", 0, 0, match_opcode, 0 }, +{"i", 0, INSN_CLASS_F, "O4,F3,D,s,j", 0, 0, match_opcode, 0 }, +{"i", 0, INSN_CLASS_F, "O4,F3,d,S,j", 0, 0, match_opcode, 0 }, +{"i", 0, INSN_CLASS_F, "O4,F3,D,S,j", 0, 0, match_opcode, 0 }, {"i", 0, INSN_CLASS_I, "O4,F3,d,o(s)", 0, 0, match_opcode, 0 }, -{"i", 0, INSN_CLASS_I, "O4,F3,D,o(s)", 0, 0, match_opcode, 0 }, +{"i", 0, INSN_CLASS_F, "O4,F3,D,o(s)", 0, 0, match_opcode, 0 }, {"s", 0, INSN_CLASS_I, "O4,F3,t,q(s)", 0, 0, match_opcode, 0 }, -{"s", 0, INSN_CLASS_I, "O4,F3,T,q(s)", 0, 0, match_opcode, 0 }, +{"s", 0, INSN_CLASS_F, "O4,F3,T,q(s)", 0, 0, match_opcode, 0 }, {"sb", 0, INSN_CLASS_I, "O4,F3,s,t,p", 0, 0, match_opcode, 0 }, -{"sb", 0, INSN_CLASS_I, "O4,F3,S,t,p", 0, 0, match_opcode, 0 }, -{"sb", 0, INSN_CLASS_I, "O4,F3,s,T,p", 0, 0, match_opcode, 0 }, -{"sb", 0, INSN_CLASS_I, "O4,F3,S,T,p", 0, 0, match_opcode, 0 }, +{"sb", 0, INSN_CLASS_F, "O4,F3,S,t,p", 0, 0, match_opcode, 0 }, +{"sb", 0, INSN_CLASS_F, "O4,F3,s,T,p", 0, 0, match_opcode, 0 }, +{"sb", 0, INSN_CLASS_F, "O4,F3,S,T,p", 0, 0, match_opcode, 0 }, {"b", 0, INSN_CLASS_I, "O4,F3,s,t,p", 0, 0, match_opcode, 0 }, -{"b", 0, INSN_CLASS_I, "O4,F3,S,t,p", 0, 0, match_opcode, 0 }, -{"b", 0, INSN_CLASS_I, "O4,F3,s,T,p", 0, 0, match_opcode, 0 }, -{"b", 0, INSN_CLASS_I, "O4,F3,S,T,p", 0, 0, match_opcode, 0 }, +{"b", 0, INSN_CLASS_F, "O4,F3,S,t,p", 0, 0, match_opcode, 0 }, +{"b", 0, INSN_CLASS_F, "O4,F3,s,T,p", 0, 0, match_opcode, 0 }, +{"b", 0, INSN_CLASS_F, "O4,F3,S,T,p", 0, 0, match_opcode, 0 }, {"u", 0, INSN_CLASS_I, "O4,d,u", 0, 0, match_opcode, 0 }, -{"u", 0, INSN_CLASS_I, "O4,D,u", 0, 0, match_opcode, 0 }, +{"u", 0, INSN_CLASS_F, "O4,D,u", 0, 0, match_opcode, 0 }, {"uj", 0, INSN_CLASS_I, "O4,d,a", 0, 0, match_opcode, 0 }, -{"uj", 0, INSN_CLASS_I, "O4,D,a", 0, 0, match_opcode, 0 }, +{"uj", 0, INSN_CLASS_F, "O4,D,a", 0, 0, match_opcode, 0 }, {"j", 0, INSN_CLASS_I, "O4,d,a", 0, 0, match_opcode, 0 }, -{"j", 0, INSN_CLASS_I, "O4,D,a", 0, 0, match_opcode, 0 }, +{"j", 0, INSN_CLASS_F, "O4,D,a", 0, 0, match_opcode, 0 }, {"cr", 0, INSN_CLASS_C, "O2,CF4,d,CV", 0, 0, match_opcode, 0 }, -{"cr", 0, INSN_CLASS_C, "O2,CF4,D,CV", 0, 0, match_opcode, 0 }, -{"cr", 0, INSN_CLASS_C, "O2,CF4,d,CT", 0, 0, match_opcode, 0 }, -{"cr", 0, INSN_CLASS_C, "O2,CF4,D,CT", 0, 0, match_opcode, 0 }, +{"cr", 0, INSN_CLASS_F_AND_C, "O2,CF4,D,CV", 0, 0, match_opcode, 0 }, +{"cr", 0, INSN_CLASS_F_AND_C, "O2,CF4,d,CT", 0, 0, match_opcode, 0 }, +{"cr", 0, INSN_CLASS_F_AND_C, "O2,CF4,D,CT", 0, 0, match_opcode, 0 }, {"ci", 0, INSN_CLASS_C, "O2,CF3,d,Co", 0, 0, match_opcode, 0 }, -{"ci", 0, INSN_CLASS_C, "O2,CF3,D,Co", 0, 0, match_opcode, 0 }, +{"ci", 0, INSN_CLASS_F_AND_C, "O2,CF3,D,Co", 0, 0, match_opcode, 0 }, {"ciw", 0, INSN_CLASS_C, "O2,CF3,Ct,C8", 0, 0, match_opcode, 0 }, -{"ciw", 0, INSN_CLASS_C, "O2,CF3,CD,C8", 0, 0, match_opcode, 0 }, +{"ciw", 0, INSN_CLASS_F_AND_C, "O2,CF3,CD,C8", 0, 0, match_opcode, 0 }, {"ca", 0, INSN_CLASS_C, "O2,CF6,CF2,Cs,Ct", 0, 0, match_opcode, 0 }, -{"ca", 0, INSN_CLASS_C, "O2,CF6,CF2,CS,Ct", 0, 0, match_opcode, 0 }, -{"ca", 0, INSN_CLASS_C, "O2,CF6,CF2,Cs,CD", 0, 0, match_opcode, 0 }, -{"ca", 0, INSN_CLASS_C, "O2,CF6,CF2,CS,CD", 0, 0, match_opcode, 0 }, +{"ca", 0, INSN_CLASS_F_AND_C, "O2,CF6,CF2,CS,Ct", 0, 0, match_opcode, 0 }, +{"ca", 0, INSN_CLASS_F_AND_C, "O2,CF6,CF2,Cs,CD", 0, 0, match_opcode, 0 }, +{"ca", 0, INSN_CLASS_F_AND_C, "O2,CF6,CF2,CS,CD", 0, 0, match_opcode, 0 }, {"cb", 0, INSN_CLASS_C, "O2,CF3,Cs,Cp", 0, 0, match_opcode, 0 }, -{"cb", 0, INSN_CLASS_C, "O2,CF3,CS,Cp", 0, 0, match_opcode, 0 }, +{"cb", 0, INSN_CLASS_F_AND_C, "O2,CF3,CS,Cp", 0, 0, match_opcode, 0 }, {"cj", 0, INSN_CLASS_C, "O2,CF3,Ca", 0, 0, match_opcode, 0 }, /* Terminate the list. */ -- cgit v1.2.3-65-gdbad