Browse Source
This patch support Zcb extension, contains new compressed instructions,
some instructions depend on other existed extension, like 'zba', 'zbb'
and 'zmmul'. Zcb also imply Zca extension to enable the compressing
features.
Co-Authored by: Charlie Keaney <charlie.keaney@embecosm.com>
Co-Authored by: Mary Bennett <mary.bennett@embecosm.com>
Co-Authored by: Nandni Jamnadas <nandni.jamnadas@embecosm.com>
Co-Authored by: Sinan Lin <sinan.lin@linux.alibaba.com>
Co-Authored by: Simon Cook <simon.cook@embecosm.com>
Co-Authored by: Shihua Liao <shihua@iscas.ac.cn>
Co-Authored by: Yulong Shi <yulong@iscas.ac.cn>
bfd/ChangeLog:
* elfxx-riscv.c (riscv_multi_subset_supports): New extension.
(riscv_multi_subset_supports_ext): Ditto.
gas/ChangeLog:
* config/tc-riscv.c (validate_riscv_insn): New operators.
(riscv_ip): Ditto.
* testsuite/gas/riscv/zcb.d: New test.
* testsuite/gas/riscv/zcb.s: New test.
include/ChangeLog:
* opcode/riscv-opc.h (MATCH_C_LBU): New opcode.
(MASK_C_LBU): New mask.
(MATCH_C_LHU): New opcode.
(MASK_C_LHU): New mask.
(MATCH_C_LH): New opcode.
(MASK_C_LH): New mask.
(MATCH_C_SB): New opcode.
(MASK_C_SB): New mask.
(MATCH_C_SH): New opcode.
(MASK_C_SH): New mask.
(MATCH_C_ZEXT_B): New opcode.
(MASK_C_ZEXT_B): New mask.
(MATCH_C_SEXT_B): New opcode.
(MASK_C_SEXT_B): New mask.
(MATCH_C_ZEXT_H): New opcode.
(MASK_C_ZEXT_H): New mask.
(MATCH_C_SEXT_H): New opcode.
(MASK_C_SEXT_H): New mask.
(MATCH_C_ZEXT_W): New opcode.
(MASK_C_ZEXT_W): New mask.
(MATCH_C_NOT): New opcode.
(MASK_C_NOT): New mask.
(MATCH_C_MUL): New opcode.
(MASK_C_MUL): New mask.
(DECLARE_INSN): New opcode.
* opcode/riscv.h (EXTRACT_ZCB_BYTE_UIMM): New inline func.
(EXTRACT_ZCB_HALFWORD_UIMM): Ditto.
(ENCODE_ZCB_BYTE_UIMM): Ditto.
(ENCODE_ZCB_HALFWORD_UIMM): Ditto.
(VALID_ZCB_BYTE_UIMM): Ditto.
(VALID_ZCB_HALFWORD_UIMM): Ditto.
(enum riscv_insn_class): New extension class.
opcodes/ChangeLog:
* riscv-dis.c (print_insn_args): New operators.
* riscv-opc.c: New instructions.
gdb-14-branch
committed by
Nelson Chu
8 changed files with 225 additions and 0 deletions
@ -0,0 +1,32 @@ |
|||
#as: -march=rv64im_zba_zbb_zcb |
|||
#objdump: -d -Mno-aliases |
|||
|
|||
.*:[ ]+file format .* |
|||
|
|||
Disassembly of section .text: |
|||
|
|||
0+000 <target>: |
|||
[ ]+[0-9a-f]+:[ ]+8020[ ]+c.lbu[ ]+s0,2\(s0\) |
|||
[ ]+[0-9a-f]+:[ ]+8380[ ]+c.lbu[ ]+s0,0\(a5\) |
|||
[ ]+[0-9a-f]+:[ ]+8420[ ]+c.lhu[ ]+s0,2\(s0\) |
|||
[ ]+[0-9a-f]+:[ ]+8780[ ]+c.lhu[ ]+s0,0\(a5\) |
|||
[ ]+[0-9a-f]+:[ ]+8460[ ]+c.lh[ ]+s0,2\(s0\) |
|||
[ ]+[0-9a-f]+:[ ]+87c0[ ]+c.lh[ ]+s0,0\(a5\) |
|||
[ ]+[0-9a-f]+:[ ]+8820[ ]+c.sb[ ]+s0,2\(s0\) |
|||
[ ]+[0-9a-f]+:[ ]+8b80[ ]+c.sb[ ]+s0,0\(a5\) |
|||
[ ]+[0-9a-f]+:[ ]+8c20[ ]+c.sh[ ]+s0,2\(s0\) |
|||
[ ]+[0-9a-f]+:[ ]+8f80[ ]+c.sh[ ]+s0,0\(a5\) |
|||
[ ]+[0-9a-f]+:[ ]+9c61[ ]+c.zext.b[ ]+s0 |
|||
[ ]+[0-9a-f]+:[ ]+9fe1[ ]+c.zext.b[ ]+a5 |
|||
[ ]+[0-9a-f]+:[ ]+9c65[ ]+c.sext.b[ ]+s0 |
|||
[ ]+[0-9a-f]+:[ ]+9fe5[ ]+c.sext.b[ ]+a5 |
|||
[ ]+[0-9a-f]+:[ ]+9c69[ ]+c.zext.h[ ]+s0 |
|||
[ ]+[0-9a-f]+:[ ]+9fe9[ ]+c.zext.h[ ]+a5 |
|||
[ ]+[0-9a-f]+:[ ]+9c6d[ ]+c.sext.h[ ]+s0 |
|||
[ ]+[0-9a-f]+:[ ]+9fed[ ]+c.sext.h[ ]+a5 |
|||
[ ]+[0-9a-f]+:[ ]+9c71[ ]+c.zext.w[ ]+s0 |
|||
[ ]+[0-9a-f]+:[ ]+9ff1[ ]+c.zext.w[ ]+a5 |
|||
[ ]+[0-9a-f]+:[ ]+9c75[ ]+c.not[ ]+s0 |
|||
[ ]+[0-9a-f]+:[ ]+9ff5[ ]+c.not[ ]+a5 |
|||
[ ]+[0-9a-f]+:[ ]+9c5d[ ]+c.mul[ ]+s0,a5 |
|||
[ ]+[0-9a-f]+:[ ]+9cd1[ ]+c.mul[ ]+s1,a2 |
|||
@ -0,0 +1,25 @@ |
|||
target: |
|||
lbu x8,2(x8) |
|||
c.lbu x8,(x15) |
|||
lhu x8,2(x8) |
|||
c.lhu x8,(x15) |
|||
lh x8,2(x8) |
|||
c.lh x8,(x15) |
|||
sb x8,2(x8) |
|||
c.sb x8,(x15) |
|||
sh x8,2(x8) |
|||
c.sh x8,(x15) |
|||
zext.b x8,x8 |
|||
c.zext.b x15 |
|||
sext.b x8,x8 |
|||
c.sext.b x15 |
|||
zext.h x8,x8 |
|||
c.zext.h x15 |
|||
sext.h x8,x8 |
|||
c.sext.h x15 |
|||
zext.w x8,x8 |
|||
c.zext.w x15 |
|||
not x8,x8 |
|||
c.not x15 |
|||
mul x8,x8,x15 |
|||
c.mul x9,x12 |
|||
Loading…
Reference in new issue