riscv: thead: Add support for the XTheadFmv ISA extension
commit75047aeb7e6af248dee47ee29bdcd57f93e7352e
authorChristoph Müllner <christoph.muellner@vrull.eu>
Sun, 4 Dec 2022 23:38:56 +0000 (5 00:38 +0100)
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>
Wed, 15 Mar 2023 09:01:16 +0000 (15 10:01 +0100)
treea3e935a80c7a3aff48e028bbb64ee5c1cc24289b
parentb2a1bef96dadcd18f1cc861b10bceaeec7cf48a6
riscv: thead: Add support for the XTheadFmv ISA extension

The XTheadFmv ISA extension provides instructions to move
data between 32-bit GP registers and 64-bit FP registers.

Co-Developed-by: Xianmiao Qu <cooper.qu@linux.alibaba.com>
Signed-off-by: Xianmiao Qu <cooper.qu@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
gcc/ChangeLog:

* config/riscv/constraints.md (TARGET_XTHEADFMV ? FP_REGS : NO_REGS)
New constraint "th_f_fmv".
(TARGET_XTHEADFMV ? GR_REGS : NO_REGS): New constraint
"th_r_fmv".
* config/riscv/riscv.cc (riscv_split_doubleword_move):
Add split code for XTheadFmv.
(riscv_secondary_memory_needed): XTheadFmv does not need
secondary memory.
* config/riscv/riscv.md: Add new UNSPEC_XTHEADFMV and
UNSPEC_XTHEADFMV_HW. Add support for XTheadFmv to
movdf_hardfloat_rv32.
* config/riscv/thead.md (th_fmv_hw_w_x): New INSN.
(th_fmv_x_w): New INSN.
(th_fmv_x_hw): New INSN.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/xtheadfmv-fmv.c: New test.
gcc/config/riscv/constraints.md
gcc/config/riscv/riscv.cc
gcc/config/riscv/riscv.md
gcc/config/riscv/thead.md
gcc/testsuite/gcc.target/riscv/xtheadfmv-fmv.c [new file with mode: 0644]