]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - include/ChangeLog
RISC-V: Add sext.[bh] and zext.[bhw] pseudo instructions.
authorNelson Chu <nelson.chu@sifive.com>
Wed, 9 Dec 2020 05:53:22 +0000 (13:53 +0800)
committerNelson Chu <nelson.chu@sifive.com>
Thu, 10 Dec 2020 02:50:44 +0000 (10:50 +0800)
commitc2137f55ad04e451d834048d4bfec1de2daea20e
tree71848a36ae6d0a7e129af78179952d016007340a
parent8152e0407c25612c6a8079cc8e1a5c1fe14afdbf
RISC-V: Add sext.[bh] and zext.[bhw] pseudo instructions.

https://github.com/riscv/riscv-asm-manual/pull/61

We aleady have sext.w, so just add sext.b, sext.h, zext.b, zext.h
and zext.w.  In a certain sense, zext.b is not a pseudo - It is an
alias of andi.  Similarly, sext.b and sext.h are aliases of other
rvb instructions, when we enable b extension; But they are pseudos
when we just enable rvi.  However, this patch does not consider the
rvb cases.  Besides, zext.w is only valid in rv64.

gas/
    * config/tc-riscv.c (riscv_ext): New function.  Use md_assemblef
    to expand the zext and sext pseudos, to give them a chance to be
    expanded into c-ext instructions.
    (macro): Handle M_ZEXTH, M_ZEXTW, M_SEXTB and M_SEXTH.
    * testsuite/gas/riscv/ext.s: New testcase.
    * testsuite/gas/riscv/ext-32.d: Likewise.
    * testsuite/gas/riscv/ext-64.d: Likewise.
include/
    * opcode/riscv.h (M_ZEXTH, M_ZEXTW, M_SEXTB, M_SEXTH.): Added.
opcodes/
    * riscv-opc.c (riscv_opcodes): Add sext.[bh] and zext.[bhw].
gas/ChangeLog
gas/config/tc-riscv.c
gas/testsuite/gas/riscv/ext-32.d [new file with mode: 0644]
gas/testsuite/gas/riscv/ext-64.d [new file with mode: 0644]
gas/testsuite/gas/riscv/ext.s [new file with mode: 0644]
include/ChangeLog
include/opcode/riscv.h
opcodes/ChangeLog
opcodes/riscv-opc.c