diff options
author | jiawei <jiawei@iscas.ac.cn> | 2022-05-30 10:35:02 +0800 |
---|---|---|
committer | Nelson Chu <nelson.chu@sifive.com> | 2022-05-30 11:42:08 +0800 |
commit | 292c7bf86de50ad643b929a7ac5769505d54e45f (patch) | |
tree | 63e803693ef4b60ba49739c59baede22892bd9e0 /gas | |
parent | 9606310bbbf8a2d529b5c2aa71cac48a46f65869 (diff) | |
download | gdb-292c7bf86de50ad643b929a7ac5769505d54e45f.zip gdb-292c7bf86de50ad643b929a7ac5769505d54e45f.tar.gz gdb-292c7bf86de50ad643b929a7ac5769505d54e45f.tar.bz2 |
RISC-V: Add zhinx extension supports.
The zhinx extension is a sub-extension in zfinx, corresponding to
zfh extension but use GPRs instead of FPRs.
This patch expanded the zfh insn class define, since zfh and zhinx
use the same opcodes, thanks for Nelson's works.
changelog in V2: Add missing classes of 'zfh' and 'zhinx' in
"riscv_multi_subset_supports_ext".
bfd/ChangeLog:
* elfxx-riscv.c (riscv_multi_subset_supports): New extensions.
(riscv_multi_subset_supports_ext): New extensions.
gas/ChangeLog:
* testsuite/gas/riscv/fp-zhinx-insns.d: New test.
* testsuite/gas/riscv/fp-zhinx-insns.s: New test.
include/ChangeLog:
* opcode/riscv.h (enum riscv_insn_class): New INSN classes.
opcodes/ChangeLog:
* riscv-opc.c: Modify INSN_CLASS.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/gas/riscv/fp-zhinx-insns.d | 66 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/fp-zhinx-insns.s | 59 |
2 files changed, 125 insertions, 0 deletions
diff --git a/gas/testsuite/gas/riscv/fp-zhinx-insns.d b/gas/testsuite/gas/riscv/fp-zhinx-insns.d new file mode 100644 index 0000000..6e1c40e --- /dev/null +++ b/gas/testsuite/gas/riscv/fp-zhinx-insns.d @@ -0,0 +1,66 @@ +#as: -march=rv64ima_zhinx +#source: fp-zhinx-insns.s +#objdump: -dr + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 <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]+fcvt.h.lu[ ]+a0,a1 +[ ]+[0-9a-f]+:[ ]+d4358553[ ]+fcvt.h.lu[ ]+a0,a1,rne +[ ]+[0-9a-f]+:[ ]+40258553[ ]+fcvt.s.h[ ]+a0,a1 +[ ]+[0-9a-f]+:[ ]+42258553[ ]+fcvt.d.h[ ]+a0,a1 +[ ]+[0-9a-f]+:[ ]+46258553[ ]+fcvt.q.h[ ]+a0,a1 +[ ]+[0-9a-f]+:[ ]+4405f553[ ]+fcvt.h.s[ ]+a0,a1 +[ ]+[0-9a-f]+:[ ]+44058553[ ]+fcvt.h.s[ ]+a0,a1,rne +[ ]+[0-9a-f]+:[ ]+4415f553[ ]+fcvt.h.d[ ]+a0,a1 +[ ]+[0-9a-f]+:[ ]+44158553[ ]+fcvt.h.d[ ]+a0,a1,rne +[ ]+[0-9a-f]+:[ ]+4435f553[ ]+fcvt.h.q[ ]+a0,a1 +[ ]+[0-9a-f]+:[ ]+44358553[ ]+fcvt.h.q[ ]+a0,a1,rne +[ ]+[0-9a-f]+:[ ]+e4059553[ ]+fclass.h[ ]+a0,a1 +[ ]+[0-9a-f]+:[ ]+a4c5a553[ ]+feq.h[ ]+a0,a1,a2 +[ ]+[0-9a-f]+:[ ]+a4c59553[ ]+flt.h[ ]+a0,a1,a2 +[ ]+[0-9a-f]+:[ ]+a4c58553[ ]+fle.h[ ]+a0,a1,a2 +[ ]+[0-9a-f]+:[ ]+a4c59553[ ]+flt.h[ ]+a0,a1,a2 +[ ]+[0-9a-f]+:[ ]+a4c58553[ ]+fle.h[ ]+a0,a1,a2 diff --git a/gas/testsuite/gas/riscv/fp-zhinx-insns.s b/gas/testsuite/gas/riscv/fp-zhinx-insns.s new file mode 100644 index 0000000..75e2d5a --- /dev/null +++ b/gas/testsuite/gas/riscv/fp-zhinx-insns.s @@ -0,0 +1,59 @@ + fneg.h a0, a1 + fabs.h a0, a1 + fsgnj.h a0, a1, a2 + fsgnjn.h a0, a1, a2 + fsgnjx.h a0, a1, a2 + fadd.h a0, a1, a2 + fadd.h a0, a1, a2, rne + fsub.h a0, a1, a2 + fsub.h a0, a1, a2, rne + fmul.h a0, a1, a2 + fmul.h a0, a1, a2, rne + fdiv.h a0, a1, a2 + fdiv.h a0, a1, a2, rne + fsqrt.h a0, a1 + fsqrt.h a0, a1, rne + fmin.h a0, a1, a2 + fmax.h a0, a1, a2 + fmadd.h a0, a1, a2, a3 + fmadd.h a0, a1, a2, a3, rne + fnmadd.h a0, a1, a2, a3 + fnmadd.h a0, a1, a2, a3, rne + fmsub.h a0, a1, a2, a3 + fmsub.h a0, a1, a2, a3, rne + fnmsub.h a0, a1, a2, a3 + fnmsub.h a0, a1, a2, a3, rne + + fcvt.w.h a0, a1 + fcvt.w.h a0, a1, rne + fcvt.wu.h a0, a1 + fcvt.wu.h a0, a1, rne + fcvt.h.w a0, a1 + fcvt.h.w a0, a1, rne + fcvt.h.wu a0, a1 + fcvt.h.wu a0, a1, rne + fcvt.l.h a0, a1 + fcvt.l.h a0, a1, rne + fcvt.lu.h a0, a1 + fcvt.lu.h a0, a1, rne + fcvt.h.l a0, a1 + fcvt.h.l a0, a1, rne + fcvt.h.lu a0, a1 + fcvt.h.lu a0, a1, rne + + fcvt.s.h a0, a1 + fcvt.d.h a0, a1 + fcvt.q.h a0, a1 + fcvt.h.s a0, a1 + fcvt.h.s a0, a1, rne + fcvt.h.d a0, a1 + fcvt.h.d a0, a1, rne + fcvt.h.q a0, a1 + fcvt.h.q a0, a1, rne + fclass.h a0, a1 + + feq.h a0, a1, a2 + flt.h a0, a1, a2 + fle.h a0, a1, a2 + fgt.h a0, a2, a1 + fge.h a0, a2, a1 |