RISC-V: make FLQ/FSQ macro-insns work
authorJan Beulich <jbeulich@suse.com>
Fri, 3 Nov 2023 09:01:19 +0000 (10:01 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 3 Nov 2023 09:01:19 +0000 (10:01 +0100)
When support for the Q extension was added, the libopcodes side of these
macro-insns was properly covered, but no backing support in gas was
added. In new testcases cover not just these, but all Q-extension insns.

gas/config/tc-riscv.c
gas/testsuite/gas/riscv/fp-q-insns-32.d [new file with mode: 0644]
gas/testsuite/gas/riscv/fp-q-insns-32.s [new file with mode: 0644]
gas/testsuite/gas/riscv/fp-q-insns-64.d [new file with mode: 0644]
gas/testsuite/gas/riscv/fp-q-insns-64.s [new file with mode: 0644]

index 09f2ea17c17f5d813ba65d2dcdf608f0cc0b662c..aa952a68edd33073591d1af2548cbf5b93a6c390 100644 (file)
@@ -2101,6 +2101,11 @@ macro (struct riscv_cl_insn *ip, expressionS *imm_expr,
                  BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I);
       break;
 
+    case M_FLQ:
+      pcrel_load (rd, rs1, imm_expr, "flq",
+                 BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I);
+      break;
+
     case M_SB:
       pcrel_store (rs2, rs1, imm_expr, "sb",
                   BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_S);
@@ -2131,6 +2136,11 @@ macro (struct riscv_cl_insn *ip, expressionS *imm_expr,
                   BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_S);
       break;
 
+    case M_FSQ:
+      pcrel_store (rs2, rs1, imm_expr, "fsq",
+                  BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_S);
+      break;
+
     case M_CALL:
       riscv_call (rd, rs1, imm_expr, *imm_reloc);
       break;
diff --git a/gas/testsuite/gas/riscv/fp-q-insns-32.d b/gas/testsuite/gas/riscv/fp-q-insns-32.d
new file mode 100644 (file)
index 0000000..355e695
--- /dev/null
@@ -0,0 +1,120 @@
+#as: -march=rv32iq
+#name: Q extension (32-bit)
+#objdump: -dwrMnumeric
+
+.*:[   ]+file format .*
+
+
+Disassembly of section .text:
+
+0+ <Q>:
+[      ]+[0-9a-f]+:[   ]+26002fd3[     ]+fabs\.q[      ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+27ffa053[     ]+fabs\.q[      ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+06007fd3[     ]+fadd\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+060ff053[     ]+fadd\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+07f07053[     ]+fadd\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+06000053[     ]+fadd\.q[      ]+f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+06001053[     ]+fadd\.q[      ]+f0,f0,f0,rtz
+[      ]+[0-9a-f]+:[   ]+06002053[     ]+fadd\.q[      ]+f0,f0,f0,rdn
+[      ]+[0-9a-f]+:[   ]+06003053[     ]+fadd\.q[      ]+f0,f0,f0,rup
+[      ]+[0-9a-f]+:[   ]+06004053[     ]+fadd\.q[      ]+f0,f0,f0,rmm
+[      ]+[0-9a-f]+:[   ]+e6001fd3[     ]+fclass\.q[    ]+x31,f0
+[      ]+[0-9a-f]+:[   ]+e60f9053[     ]+fclass\.q[    ]+x0,f31
+[      ]+[0-9a-f]+:[   ]+42307fd3[     ]+fcvt\.d\.q[   ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+423ff053[     ]+fcvt\.d\.q[   ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+42300053[     ]+fcvt\.d\.q[   ]+f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+46100fd3[     ]+fcvt\.q\.d[   ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+461f8053[     ]+fcvt\.q\.d[   ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+46000fd3[     ]+fcvt\.q\.s[   ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+460f8053[     ]+fcvt\.q\.s[   ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+d6000fd3[     ]+fcvt\.q\.w[   ]+f31,x0
+[      ]+[0-9a-f]+:[   ]+d60f8053[     ]+fcvt\.q\.w[   ]+f0,x31
+[      ]+[0-9a-f]+:[   ]+d6100053[     ]+fcvt\.q\.wu[  ]+f0,x0
+[      ]+[0-9a-f]+:[   ]+40307fd3[     ]+fcvt\.s\.q[   ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+403ff053[     ]+fcvt\.s\.q[   ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+40300053[     ]+fcvt\.s\.q[   ]+f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+c6007fd3[     ]+fcvt\.w\.q[   ]+x31,f0
+[      ]+[0-9a-f]+:[   ]+c60ff053[     ]+fcvt\.w\.q[   ]+x0,f31
+[      ]+[0-9a-f]+:[   ]+c6000053[     ]+fcvt\.w\.q[   ]+x0,f0,rne
+[      ]+[0-9a-f]+:[   ]+c6107053[     ]+fcvt\.wu\.q[  ]+x0,f0
+[      ]+[0-9a-f]+:[   ]+1e007fd3[     ]+fdiv\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+1e0ff053[     ]+fdiv\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+1ff07053[     ]+fdiv\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+1e000053[     ]+fdiv\.q[      ]+f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+a6002fd3[     ]+feq\.q[       ]+x31,f0,f0
+[      ]+[0-9a-f]+:[   ]+a60fa053[     ]+feq\.q[       ]+x0,f31,f0
+[      ]+[0-9a-f]+:[   ]+a7f02053[     ]+feq\.q[       ]+x0,f0,f31
+[      ]+[0-9a-f]+:[   ]+a6000fd3[     ]+fle\.q[       ]+x31,f0,f0
+[      ]+[0-9a-f]+:[   ]+a7f00053[     ]+fle\.q[       ]+x0,f0,f31
+[      ]+[0-9a-f]+:[   ]+a60f8053[     ]+fle\.q[       ]+x0,f31,f0
+[      ]+[0-9a-f]+:[   ]+a6001fd3[     ]+flt\.q[       ]+x31,f0,f0
+[      ]+[0-9a-f]+:[   ]+a7f01053[     ]+flt\.q[       ]+x0,f0,f31
+[      ]+[0-9a-f]+:[   ]+a60f9053[     ]+flt\.q[       ]+x0,f31,f0
+[      ]+[0-9a-f]+:[   ]+a6000fd3[     ]+fle\.q[       ]+x31,f0,f0
+[      ]+[0-9a-f]+:[   ]+a60f8053[     ]+fle\.q[       ]+x0,f31,f0
+[      ]+[0-9a-f]+:[   ]+a7f00053[     ]+fle\.q[       ]+x0,f0,f31
+[      ]+[0-9a-f]+:[   ]+00004f87[     ]+flq[  ]+f31,0\(x0\) # 0( <.*>)?
+[      ]+[0-9a-f]+:[   ]+7ff04007[     ]+flq[  ]+f0,2047\(x0\) # 7ff( <.*>)?
+[      ]+[0-9a-f]+:[   ]+80004007[     ]+flq[  ]+f0,-2048\(x0\) # fffff800( <.*>)?
+[      ]+[0-9a-f]+:[   ]+000fc007[     ]+flq[  ]+f0,0\(x31\)
+[      ]+[0-9a-f]+:[   ]+00000f97[     ]+auipc[        ]+x31,0x0[      ]+[0-9a-f]+:[   ]+R_RISCV_PCREL_HI20[   ]+qvar
+[      ]+[0-9a-f]+:[   ]+R_RISCV_RELAX.*
+[      ]+[0-9a-f]+:[   ]+000fc007[     ]+flq[  ]+f0,0\(x31\) # [0-9a-f]+( <.*>)?[      ]+[0-9a-f]+:[   ]+R_RISCV_PCREL_LO12_I[         ]+.*
+[      ]+[0-9a-f]+:[   ]+R_RISCV_RELAX.*
+[      ]+[0-9a-f]+:[   ]+a6001fd3[     ]+flt\.q[       ]+x31,f0,f0
+[      ]+[0-9a-f]+:[   ]+a60f9053[     ]+flt\.q[       ]+x0,f31,f0
+[      ]+[0-9a-f]+:[   ]+a7f01053[     ]+flt\.q[       ]+x0,f0,f31
+[      ]+[0-9a-f]+:[   ]+06007fc3[     ]+fmadd\.q[     ]+f31,f0,f0,f0
+[      ]+[0-9a-f]+:[   ]+060ff043[     ]+fmadd\.q[     ]+f0,f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+07f07043[     ]+fmadd\.q[     ]+f0,f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+fe007043[     ]+fmadd\.q[     ]+f0,f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+06000043[     ]+fmadd\.q[     ]+f0,f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+2e001fd3[     ]+fmax\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+2e0f9053[     ]+fmax\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+2ff01053[     ]+fmax\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+2e000fd3[     ]+fmin\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+2e0f8053[     ]+fmin\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+2ff00053[     ]+fmin\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+06007fc7[     ]+fmsub\.q[     ]+f31,f0,f0,f0
+[      ]+[0-9a-f]+:[   ]+060ff047[     ]+fmsub\.q[     ]+f0,f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+07f07047[     ]+fmsub\.q[     ]+f0,f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+fe007047[     ]+fmsub\.q[     ]+f0,f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+06000047[     ]+fmsub\.q[     ]+f0,f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+16007fd3[     ]+fmul\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+160ff053[     ]+fmul\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+17f07053[     ]+fmul\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+16000053[     ]+fmul\.q[      ]+f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+26000fd3[     ]+fmv\.q[       ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+27ff8053[     ]+fmv\.q[       ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+26001fd3[     ]+fneg\.q[      ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+27ff9053[     ]+fneg\.q[      ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+06007fcf[     ]+fnmadd\.q[    ]+f31,f0,f0,f0
+[      ]+[0-9a-f]+:[   ]+060ff04f[     ]+fnmadd\.q[    ]+f0,f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+07f0704f[     ]+fnmadd\.q[    ]+f0,f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+fe00704f[     ]+fnmadd\.q[    ]+f0,f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+0600004f[     ]+fnmadd\.q[    ]+f0,f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+0600704b[     ]+fnmsub\.q[    ]+f0,f0,f0,f0
+[      ]+[0-9a-f]+:[   ]+060ff04b[     ]+fnmsub\.q[    ]+f0,f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+07f0704b[     ]+fnmsub\.q[    ]+f0,f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+fe00704b[     ]+fnmsub\.q[    ]+f0,f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+0600004b[     ]+fnmsub\.q[    ]+f0,f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+26100fd3[     ]+fsgnj\.q[     ]+f31,f0,f1
+[      ]+[0-9a-f]+:[   ]+260f8053[     ]+fsgnj\.q[     ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+27f00053[     ]+fsgnj\.q[     ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+26009053[     ]+fsgnjn\.q[    ]+f0,f1,f0
+[      ]+[0-9a-f]+:[   ]+2600a053[     ]+fsgnjx\.q[    ]+f0,f1,f0
+[      ]+[0-9a-f]+:[   ]+01f04027[     ]+fsq[  ]+f31,0\(x0\) # 0( <.*>)?
+[      ]+[0-9a-f]+:[   ]+00004fa7[     ]+fsq[  ]+f0,31\(x0\) # 1f( <.*>)?
+[      ]+[0-9a-f]+:[   ]+fe004027[     ]+fsq[  ]+f0,-32\(x0\) # ffffffe0( <.*>)?
+[      ]+[0-9a-f]+:[   ]+000fc027[     ]+fsq[  ]+f0,0\(x31\)
+[      ]+[0-9a-f]+:[   ]+00000f97[     ]+auipc[        ]+x31,0x0[      ]+[0-9a-f]+:[   ]+R_RISCV_PCREL_HI20[   ]+qvar
+[      ]+[0-9a-f]+:[   ]+R_RISCV_RELAX.*
+[      ]+[0-9a-f]+:[   ]+000fc027[     ]+fsq[  ]+f0,0\(x31\) # [0-9a-f]+( <.*>)?[      ]+[0-9a-f]+:[   ]+R_RISCV_PCREL_LO12_S[         ]+.*
+[      ]+[0-9a-f]+:[   ]+R_RISCV_RELAX.*
+[      ]+[0-9a-f]+:[   ]+5e007fd3[     ]+fsqrt\.q[     ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+5e0ff053[     ]+fsqrt\.q[     ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+5e000053[     ]+fsqrt\.q[     ]+f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+0e007fd3[     ]+fsub\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+0e0ff053[     ]+fsub\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+0ff07053[     ]+fsub\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+0e000053[     ]+fsub\.q[      ]+f0,f0,f0,rne
diff --git a/gas/testsuite/gas/riscv/fp-q-insns-32.s b/gas/testsuite/gas/riscv/fp-q-insns-32.s
new file mode 100644 (file)
index 0000000..ef97411
--- /dev/null
@@ -0,0 +1,128 @@
+Q:
+       fabs.q  f31, f0
+       fabs.q  f0, f31
+
+       fadd.q  f31, f0, f0
+       fadd.q  f0, f31, f0
+       fadd.q  f0, f0, f31
+       fadd.q  f0, f0, f0, rne
+       fadd.q  f0, f0, f0, rtz
+       fadd.q  f0, f0, f0, rdn
+       fadd.q  f0, f0, f0, rup
+       fadd.q  f0, f0, f0, rmm
+
+       fclass.q x31, f0
+       fclass.q x0, f31
+
+       fcvt.d.q f31, f0
+       fcvt.d.q f0, f31
+       fcvt.d.q f0, f0, rne
+       fcvt.q.d f31, f0
+       fcvt.q.d f0, f31
+       fcvt.q.s f31, f0
+       fcvt.q.s f0, f31
+       fcvt.q.w f31, x0
+       fcvt.q.w f0, x31
+       fcvt.q.wu f0, x0
+       fcvt.s.q f31, f0
+       fcvt.s.q f0, f31
+       fcvt.s.q f0, f0, rne
+       fcvt.w.q x31, f0
+       fcvt.w.q x0, f31
+       fcvt.w.q x0, f0, rne
+       fcvt.wu.q x0, f0
+
+       fdiv.q  f31, f0, f0
+       fdiv.q  f0, f31, f0
+       fdiv.q  f0, f0, f31
+       fdiv.q  f0, f0, f0, rne
+
+       feq.q   x31, f0, f0
+       feq.q   x0, f31, f0
+       feq.q   x0, f0, f31
+
+       fge.q   x31, f0, f0
+       fge.q   x0, f31, f0
+       fge.q   x0, f0, f31
+
+       fgt.q   x31, f0, f0
+       fgt.q   x0, f31, f0
+       fgt.q   x0, f0, f31
+
+       fle.q   x31, f0, f0
+       fle.q   x0, f31, f0
+       fle.q   x0, f0, f31
+
+       flq     f31, (x0)
+       flq     f0, 0x7ff(x0)
+       flq     f0, -0x800(x0)
+       flq     f0, (x31)
+       flq     f0, qvar, x31
+
+       flt.q   x31, f0, f0
+       flt.q   x0, f31, f0
+       flt.q   x0, f0, f31
+
+       fmadd.q f31, f0, f0, f0
+       fmadd.q f0, f31, f0, f0
+       fmadd.q f0, f0, f31, f0
+       fmadd.q f0, f0, f0, f31
+       fmadd.q f0, f0, f0, f0, rne
+
+       fmax.q  f31, f0, f0
+       fmax.q  f0, f31, f0
+       fmax.q  f0, f0, f31
+
+       fmin.q  f31, f0, f0
+       fmin.q  f0, f31, f0
+       fmin.q  f0, f0, f31
+
+       fmsub.q f31, f0, f0, f0
+       fmsub.q f0, f31, f0, f0
+       fmsub.q f0, f0, f31, f0
+       fmsub.q f0, f0, f0, f31
+       fmsub.q f0, f0, f0, f0, rne
+
+       fmul.q  f31, f0, f0
+       fmul.q  f0, f31, f0
+       fmul.q  f0, f0, f31
+       fmul.q  f0, f0, f0, rne
+
+       fmv.q   f31, f0
+       fmv.q   f0, f31
+
+       fneg.q  f31, f0
+       fneg.q  f0, f31
+
+       fnmadd.q f31, f0, f0, f0
+       fnmadd.q f0, f31, f0, f0
+       fnmadd.q f0, f0, f31, f0
+       fnmadd.q f0, f0, f0, f31
+       fnmadd.q f0, f0, f0, f0, rne
+
+       fnmsub.q f0, f0, f0, f0
+       fnmsub.q f0, f31, f0, f0
+       fnmsub.q f0, f0, f31, f0
+       fnmsub.q f0, f0, f0, f31
+       fnmsub.q f0, f0, f0, f0, rne
+
+       fsgnj.q f31, f0, f1
+       fsgnj.q f0, f31, f0
+       fsgnj.q f0, f0, f31
+       fsgnjn.q f0, f1, f0
+       fsgnjx.q f0, f1, f0
+
+       fsq     f31, (x0)
+       fsq     f0, 0x1f(x0)
+       fsq     f0, -0x20(x0)
+       fsq     f0, (x31)
+       fsq     f0, qvar, x31
+
+       fsqrt.q f31, f0
+       fsqrt.q f0, f31
+       fsqrt.q f0, f0, rne
+
+       fsub.q  f31, f0, f0
+       fsub.q  f0, f31, f0
+       fsub.q  f0, f0, f31
+       fsub.q  f0, f0, f0, rne
diff --git a/gas/testsuite/gas/riscv/fp-q-insns-64.d b/gas/testsuite/gas/riscv/fp-q-insns-64.d
new file mode 100644 (file)
index 0000000..6faebf5
--- /dev/null
@@ -0,0 +1,125 @@
+#as: -march=rv64iq
+#name: Q extension (64-bit)
+#objdump: -dwrMnumeric
+
+.*:[   ]+file format .*
+
+
+Disassembly of section .text:
+
+0+ <Q>:
+[      ]+[0-9a-f]+:[   ]+26002fd3[     ]+fabs\.q[      ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+27ffa053[     ]+fabs\.q[      ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+06007fd3[     ]+fadd\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+060ff053[     ]+fadd\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+07f07053[     ]+fadd\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+06000053[     ]+fadd\.q[      ]+f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+06001053[     ]+fadd\.q[      ]+f0,f0,f0,rtz
+[      ]+[0-9a-f]+:[   ]+06002053[     ]+fadd\.q[      ]+f0,f0,f0,rdn
+[      ]+[0-9a-f]+:[   ]+06003053[     ]+fadd\.q[      ]+f0,f0,f0,rup
+[      ]+[0-9a-f]+:[   ]+06004053[     ]+fadd\.q[      ]+f0,f0,f0,rmm
+[      ]+[0-9a-f]+:[   ]+e6001fd3[     ]+fclass\.q[    ]+x31,f0
+[      ]+[0-9a-f]+:[   ]+e60f9053[     ]+fclass\.q[    ]+x0,f31
+[      ]+[0-9a-f]+:[   ]+42307fd3[     ]+fcvt\.d\.q[   ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+423ff053[     ]+fcvt\.d\.q[   ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+42300053[     ]+fcvt\.d\.q[   ]+f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+c6207053[     ]+fcvt\.l\.q[   ]+x0,f0
+[      ]+[0-9a-f]+:[   ]+c6200053[     ]+fcvt\.l\.q[   ]+x0,f0,rne
+[      ]+[0-9a-f]+:[   ]+c6307053[     ]+fcvt\.lu\.q[  ]+x0,f0
+[      ]+[0-9a-f]+:[   ]+46100fd3[     ]+fcvt\.q\.d[   ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+461f8053[     ]+fcvt\.q\.d[   ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+d6200053[     ]+fcvt\.q\.l[   ]+f0,x0
+[      ]+[0-9a-f]+:[   ]+d6300053[     ]+fcvt\.q\.lu[  ]+f0,x0
+[      ]+[0-9a-f]+:[   ]+46000fd3[     ]+fcvt\.q\.s[   ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+460f8053[     ]+fcvt\.q\.s[   ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+d6000fd3[     ]+fcvt\.q\.w[   ]+f31,x0
+[      ]+[0-9a-f]+:[   ]+d60f8053[     ]+fcvt\.q\.w[   ]+f0,x31
+[      ]+[0-9a-f]+:[   ]+d6100053[     ]+fcvt\.q\.wu[  ]+f0,x0
+[      ]+[0-9a-f]+:[   ]+40307fd3[     ]+fcvt\.s\.q[   ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+403ff053[     ]+fcvt\.s\.q[   ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+40300053[     ]+fcvt\.s\.q[   ]+f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+c6007fd3[     ]+fcvt\.w\.q[   ]+x31,f0
+[      ]+[0-9a-f]+:[   ]+c60ff053[     ]+fcvt\.w\.q[   ]+x0,f31
+[      ]+[0-9a-f]+:[   ]+c6000053[     ]+fcvt\.w\.q[   ]+x0,f0,rne
+[      ]+[0-9a-f]+:[   ]+c6107053[     ]+fcvt\.wu\.q[  ]+x0,f0
+[      ]+[0-9a-f]+:[   ]+1e007fd3[     ]+fdiv\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+1e0ff053[     ]+fdiv\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+1ff07053[     ]+fdiv\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+1e000053[     ]+fdiv\.q[      ]+f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+a6002fd3[     ]+feq\.q[       ]+x31,f0,f0
+[      ]+[0-9a-f]+:[   ]+a60fa053[     ]+feq\.q[       ]+x0,f31,f0
+[      ]+[0-9a-f]+:[   ]+a7f02053[     ]+feq\.q[       ]+x0,f0,f31
+[      ]+[0-9a-f]+:[   ]+a6000fd3[     ]+fle\.q[       ]+x31,f0,f0
+[      ]+[0-9a-f]+:[   ]+a7f00053[     ]+fle\.q[       ]+x0,f0,f31
+[      ]+[0-9a-f]+:[   ]+a60f8053[     ]+fle\.q[       ]+x0,f31,f0
+[      ]+[0-9a-f]+:[   ]+a6001fd3[     ]+flt\.q[       ]+x31,f0,f0
+[      ]+[0-9a-f]+:[   ]+a7f01053[     ]+flt\.q[       ]+x0,f0,f31
+[      ]+[0-9a-f]+:[   ]+a60f9053[     ]+flt\.q[       ]+x0,f31,f0
+[      ]+[0-9a-f]+:[   ]+a6000fd3[     ]+fle\.q[       ]+x31,f0,f0
+[      ]+[0-9a-f]+:[   ]+a60f8053[     ]+fle\.q[       ]+x0,f31,f0
+[      ]+[0-9a-f]+:[   ]+a7f00053[     ]+fle\.q[       ]+x0,f0,f31
+[      ]+[0-9a-f]+:[   ]+00004f87[     ]+flq[  ]+f31,0\(x0\) # 0( <.*>)?
+[      ]+[0-9a-f]+:[   ]+7ff04007[     ]+flq[  ]+f0,2047\(x0\) # 7ff( <.*>)?
+[      ]+[0-9a-f]+:[   ]+80004007[     ]+flq[  ]+f0,-2048\(x0\) # f+800( <.*>)?
+[      ]+[0-9a-f]+:[   ]+000fc007[     ]+flq[  ]+f0,0\(x31\)
+[      ]+[0-9a-f]+:[   ]+00000f97[     ]+auipc[        ]+x31,0x0[      ]+[0-9a-f]+:[   ]+R_RISCV_PCREL_HI20[   ]+qvar
+[      ]+[0-9a-f]+:[   ]+R_RISCV_RELAX.*
+[      ]+[0-9a-f]+:[   ]+000fc007[     ]+flq[  ]+f0,0\(x31\) # [0-9a-f]+( <.*>)?[      ]+[0-9a-f]+:[   ]+R_RISCV_PCREL_LO12_I[         ]+.*
+[      ]+[0-9a-f]+:[   ]+R_RISCV_RELAX.*
+[      ]+[0-9a-f]+:[   ]+a6001fd3[     ]+flt\.q[       ]+x31,f0,f0
+[      ]+[0-9a-f]+:[   ]+a60f9053[     ]+flt\.q[       ]+x0,f31,f0
+[      ]+[0-9a-f]+:[   ]+a7f01053[     ]+flt\.q[       ]+x0,f0,f31
+[      ]+[0-9a-f]+:[   ]+06007fc3[     ]+fmadd\.q[     ]+f31,f0,f0,f0
+[      ]+[0-9a-f]+:[   ]+060ff043[     ]+fmadd\.q[     ]+f0,f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+07f07043[     ]+fmadd\.q[     ]+f0,f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+fe007043[     ]+fmadd\.q[     ]+f0,f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+06000043[     ]+fmadd\.q[     ]+f0,f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+2e001fd3[     ]+fmax\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+2e0f9053[     ]+fmax\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+2ff01053[     ]+fmax\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+2e000fd3[     ]+fmin\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+2e0f8053[     ]+fmin\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+2ff00053[     ]+fmin\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+06007fc7[     ]+fmsub\.q[     ]+f31,f0,f0,f0
+[      ]+[0-9a-f]+:[   ]+060ff047[     ]+fmsub\.q[     ]+f0,f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+07f07047[     ]+fmsub\.q[     ]+f0,f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+fe007047[     ]+fmsub\.q[     ]+f0,f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+06000047[     ]+fmsub\.q[     ]+f0,f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+16007fd3[     ]+fmul\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+160ff053[     ]+fmul\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+17f07053[     ]+fmul\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+16000053[     ]+fmul\.q[      ]+f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+26000fd3[     ]+fmv\.q[       ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+27ff8053[     ]+fmv\.q[       ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+26001fd3[     ]+fneg\.q[      ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+27ff9053[     ]+fneg\.q[      ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+06007fcf[     ]+fnmadd\.q[    ]+f31,f0,f0,f0
+[      ]+[0-9a-f]+:[   ]+060ff04f[     ]+fnmadd\.q[    ]+f0,f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+07f0704f[     ]+fnmadd\.q[    ]+f0,f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+fe00704f[     ]+fnmadd\.q[    ]+f0,f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+0600004f[     ]+fnmadd\.q[    ]+f0,f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+0600704b[     ]+fnmsub\.q[    ]+f0,f0,f0,f0
+[      ]+[0-9a-f]+:[   ]+060ff04b[     ]+fnmsub\.q[    ]+f0,f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+07f0704b[     ]+fnmsub\.q[    ]+f0,f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+fe00704b[     ]+fnmsub\.q[    ]+f0,f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+0600004b[     ]+fnmsub\.q[    ]+f0,f0,f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+26100fd3[     ]+fsgnj\.q[     ]+f31,f0,f1
+[      ]+[0-9a-f]+:[   ]+260f8053[     ]+fsgnj\.q[     ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+27f00053[     ]+fsgnj\.q[     ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+26009053[     ]+fsgnjn\.q[    ]+f0,f1,f0
+[      ]+[0-9a-f]+:[   ]+2600a053[     ]+fsgnjx\.q[    ]+f0,f1,f0
+[      ]+[0-9a-f]+:[   ]+01f04027[     ]+fsq[  ]+f31,0\(x0\) # 0( <.*>)?
+[      ]+[0-9a-f]+:[   ]+00004fa7[     ]+fsq[  ]+f0,31\(x0\) # 1f( <.*>)?
+[      ]+[0-9a-f]+:[   ]+fe004027[     ]+fsq[  ]+f0,-32\(x0\) # f+e0( <.*>)?
+[      ]+[0-9a-f]+:[   ]+000fc027[     ]+fsq[  ]+f0,0\(x31\)
+[      ]+[0-9a-f]+:[   ]+00000f97[     ]+auipc[        ]+x31,0x0[      ]+[0-9a-f]+:[   ]+R_RISCV_PCREL_HI20[   ]+qvar
+[      ]+[0-9a-f]+:[   ]+R_RISCV_RELAX.*
+[      ]+[0-9a-f]+:[   ]+000fc027[     ]+fsq[  ]+f0,0\(x31\) # [0-9a-f]+( <.*>)?[      ]+[0-9a-f]+:[   ]+R_RISCV_PCREL_LO12_S[         ]+.*
+[      ]+[0-9a-f]+:[   ]+R_RISCV_RELAX.*
+[      ]+[0-9a-f]+:[   ]+5e007fd3[     ]+fsqrt\.q[     ]+f31,f0
+[      ]+[0-9a-f]+:[   ]+5e0ff053[     ]+fsqrt\.q[     ]+f0,f31
+[      ]+[0-9a-f]+:[   ]+5e000053[     ]+fsqrt\.q[     ]+f0,f0,rne
+[      ]+[0-9a-f]+:[   ]+0e007fd3[     ]+fsub\.q[      ]+f31,f0,f0
+[      ]+[0-9a-f]+:[   ]+0e0ff053[     ]+fsub\.q[      ]+f0,f31,f0
+[      ]+[0-9a-f]+:[   ]+0ff07053[     ]+fsub\.q[      ]+f0,f0,f31
+[      ]+[0-9a-f]+:[   ]+0e000053[     ]+fsub\.q[      ]+f0,f0,f0,rne
diff --git a/gas/testsuite/gas/riscv/fp-q-insns-64.s b/gas/testsuite/gas/riscv/fp-q-insns-64.s
new file mode 100644 (file)
index 0000000..553c6d3
--- /dev/null
@@ -0,0 +1,133 @@
+Q:
+       fabs.q  f31, f0
+       fabs.q  f0, f31
+
+       fadd.q  f31, f0, f0
+       fadd.q  f0, f31, f0
+       fadd.q  f0, f0, f31
+       fadd.q  f0, f0, f0, rne
+       fadd.q  f0, f0, f0, rtz
+       fadd.q  f0, f0, f0, rdn
+       fadd.q  f0, f0, f0, rup
+       fadd.q  f0, f0, f0, rmm
+
+       fclass.q x31, f0
+       fclass.q x0, f31
+
+       fcvt.d.q f31, f0
+       fcvt.d.q f0, f31
+       fcvt.d.q f0, f0, rne
+       fcvt.l.q x0, f0
+       fcvt.l.q x0, f0, rne
+       fcvt.lu.q x0, f0
+       fcvt.q.d f31, f0
+       fcvt.q.d f0, f31
+       fcvt.q.l f0, x0
+       fcvt.q.lu f0, x0
+       fcvt.q.s f31, f0
+       fcvt.q.s f0, f31
+       fcvt.q.w f31, x0
+       fcvt.q.w f0, x31
+       fcvt.q.wu f0, x0
+       fcvt.s.q f31, f0
+       fcvt.s.q f0, f31
+       fcvt.s.q f0, f0, rne
+       fcvt.w.q x31, f0
+       fcvt.w.q x0, f31
+       fcvt.w.q x0, f0, rne
+       fcvt.wu.q x0, f0
+
+       fdiv.q  f31, f0, f0
+       fdiv.q  f0, f31, f0
+       fdiv.q  f0, f0, f31
+       fdiv.q  f0, f0, f0, rne
+
+       feq.q   x31, f0, f0
+       feq.q   x0, f31, f0
+       feq.q   x0, f0, f31
+
+       fge.q   x31, f0, f0
+       fge.q   x0, f31, f0
+       fge.q   x0, f0, f31
+
+       fgt.q   x31, f0, f0
+       fgt.q   x0, f31, f0
+       fgt.q   x0, f0, f31
+
+       fle.q   x31, f0, f0
+       fle.q   x0, f31, f0
+       fle.q   x0, f0, f31
+
+       flq     f31, (x0)
+       flq     f0, 0x7ff(x0)
+       flq     f0, -0x800(x0)
+       flq     f0, (x31)
+       flq     f0, qvar, x31
+
+       flt.q   x31, f0, f0
+       flt.q   x0, f31, f0
+       flt.q   x0, f0, f31
+
+       fmadd.q f31, f0, f0, f0
+       fmadd.q f0, f31, f0, f0
+       fmadd.q f0, f0, f31, f0
+       fmadd.q f0, f0, f0, f31
+       fmadd.q f0, f0, f0, f0, rne
+
+       fmax.q  f31, f0, f0
+       fmax.q  f0, f31, f0
+       fmax.q  f0, f0, f31
+
+       fmin.q  f31, f0, f0
+       fmin.q  f0, f31, f0
+       fmin.q  f0, f0, f31
+
+       fmsub.q f31, f0, f0, f0
+       fmsub.q f0, f31, f0, f0
+       fmsub.q f0, f0, f31, f0
+       fmsub.q f0, f0, f0, f31
+       fmsub.q f0, f0, f0, f0, rne
+
+       fmul.q  f31, f0, f0
+       fmul.q  f0, f31, f0
+       fmul.q  f0, f0, f31
+       fmul.q  f0, f0, f0, rne
+
+       fmv.q   f31, f0
+       fmv.q   f0, f31
+
+       fneg.q  f31, f0
+       fneg.q  f0, f31
+
+       fnmadd.q f31, f0, f0, f0
+       fnmadd.q f0, f31, f0, f0
+       fnmadd.q f0, f0, f31, f0
+       fnmadd.q f0, f0, f0, f31
+       fnmadd.q f0, f0, f0, f0, rne
+
+       fnmsub.q f0, f0, f0, f0
+       fnmsub.q f0, f31, f0, f0
+       fnmsub.q f0, f0, f31, f0
+       fnmsub.q f0, f0, f0, f31
+       fnmsub.q f0, f0, f0, f0, rne
+
+       fsgnj.q f31, f0, f1
+       fsgnj.q f0, f31, f0
+       fsgnj.q f0, f0, f31
+       fsgnjn.q f0, f1, f0
+       fsgnjx.q f0, f1, f0
+
+       fsq     f31, (x0)
+       fsq     f0, 0x1f(x0)
+       fsq     f0, -0x20(x0)
+       fsq     f0, (x31)
+       fsq     f0, qvar, x31
+
+       fsqrt.q f31, f0
+       fsqrt.q f0, f31
+       fsqrt.q f0, f0, rne
+
+       fsub.q  f31, f0, f0
+       fsub.q  f0, f31, f0
+       fsub.q  f0, f0, f31
+       fsub.q  f0, f0, f0, rne