RISC-V: THEAD: Add 5 assembly pseudoinstructions for XTheadVector extension
authorJin Ma <jinma@linux.alibaba.com>
Mon, 25 Dec 2023 08:49:21 +0000 (16:49 +0800)
committerNelson Chu <nelson@rivosinc.com>
Fri, 29 Dec 2023 00:55:30 +0000 (08:55 +0800)
commit77d242a06e352eee88908326d7bbf3b77086d5db
treef4b2b3738ae45273be8f53ee4ec815116842932e
parent0e2ec3dbce8a3948277e7b02ece0d926ac8a4253
RISC-V: THEAD: Add 5 assembly pseudoinstructions for XTheadVector extension

In order to make it easier to complete the compiler's support for
the XTheadVector extension and to be as compatible as possible
with the programming model of the 'V' extension ([1]), we consider
adding a few pseudo instructions ([2]).

th.vmmv.m vd,vs => th.vmand.mm vd,vs,vs
th.vneg.v vd,vs => th.vrsub.vx vd,vs,x0
th.vncvt.x.x.v vd,vs,vm => th.vnsrl.vx vd,vs,x0,vm
th.vfneg.v vd,vs => th.vfsgnjn.vv vd,vs,vs
th.vfabs.v vd,vs => th.vfsgnjx.vv vd,vs,vs

Ref:
[1] https://gcc.gnu.org/pipermail/gcc-patches/2023-December/641302.html
[2] https://github.com/T-head-Semi/thead-extension-spec/pull/40

Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Co-developed-by: Christoph Müllner <christoph.muellner@vrull.eu>
gas/ChangeLog:

* testsuite/gas/riscv/x-thead-vector.d: Add tests for new
pseudoinstructions.
* testsuite/gas/riscv/x-thead-vector.s: Likewise.

opcodes/ChangeLog:

* riscv-opc.c: Add new pseudoinstructions.
gas/testsuite/gas/riscv/x-thead-vector.d
gas/testsuite/gas/riscv/x-thead-vector.s
opcodes/riscv-opc.c