-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RISC-V: Add support for the 'Zihintntl' extension
This commit adds 'Zihintntl' extension and its hint instructions. This is based on: <riscv/riscv-isa-manual@0dc91f5>, the first ISA Manual noting that the 'Zihintntl' extension is ratified. Note that compressed 'Zihintntl' hints require either 'C' or 'Zca' extensions. bfd/ChangeLog: * elfxx-riscv.c (riscv_supported_std_z_ext): Add 'Zihintntl' standard hint 'Z' extension. (riscv_multi_subset_supports): Support new instruction classes. (riscv_multi_subset_supports_ext): Likewise. gas/ChangeLog: * testsuite/gas/riscv/zihintntl.s: New test for 'Zihintntl' including auto-compression without C prefix and explicit C prefix. * testsuite/gas/riscv/zihintntl.d: Likewise. * testsuite/gas/riscv/zihintntl-na.d: Likewise. * testsuite/gas/riscv/zihintntl-base.s: New test for correspondence between 'Zihintntl' and base 'I' or 'C' instructions. * testsuite/gas/riscv/zihintntl-base.d: Likewise. include/ChangeLog: * opcode/riscv.h (enum riscv_insn_class): Add new instruction classes: INSN_CLASS_ZIHINTNTL and INSN_CLASS_ZIHINTNTL_AND_C. (MASK_NTL_P1, MATCH_NTL_P1, MASK_NTL_PALL, MATCH_NTL_PALL, MASK_NTL_S1, MATCH_NTL_S1, MASK_NTL_ALL, MATCH_NTL_ALL, MASK_C_NTL_P1, MATCH_C_NTL_P1, MASK_C_NTL_PALL, MATCH_C_NTL_PALL, MASK_C_NTL_S1, MATCH_C_NTL_S1, MASK_C_NTL_ALL, MATCH_C_NTL_ALL): New. opcodes/ChangeLog: * riscv-opc.c (riscv_opcodes): Add instructions from the 'Zihintntl' extension.
- Loading branch information
Showing
9 changed files
with
208 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#as: -march=rv32i_zihintntl | ||
#objdump: -d | ||
|
||
.*:[ ]+file format .* | ||
|
||
Disassembly of section .text: | ||
|
||
0+000 <target>: | ||
[ ]+[0-9a-f]+:[ ]+00200033[ ]+ntl\.p1 | ||
[ ]+[0-9a-f]+:[ ]+01b28023[ ]+sb[ ]+s11,0\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+00300033[ ]+ntl\.pall | ||
[ ]+[0-9a-f]+:[ ]+01b28123[ ]+sb[ ]+s11,2\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+00400033[ ]+ntl\.s1 | ||
[ ]+[0-9a-f]+:[ ]+01b28223[ ]+sb[ ]+s11,4\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+00500033[ ]+ntl\.all | ||
[ ]+[0-9a-f]+:[ ]+01b28323[ ]+sb[ ]+s11,6\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+900a[ ]+ntl\.p1 | ||
[ ]+[0-9a-f]+:[ ]+01b28423[ ]+sb[ ]+s11,8\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+900e[ ]+ntl\.pall | ||
[ ]+[0-9a-f]+:[ ]+01b28523[ ]+sb[ ]+s11,10\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+9012[ ]+ntl\.s1 | ||
[ ]+[0-9a-f]+:[ ]+01b28623[ ]+sb[ ]+s11,12\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+9016[ ]+ntl\.all | ||
[ ]+[0-9a-f]+:[ ]+01b28723[ ]+sb[ ]+s11,14\(t0\) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
target: | ||
# ntl.p1 == add x0, x0, x2 | ||
# ntl.pall == add x0, x0, x3 | ||
# ntl.s1 == add x0, x0, x4 | ||
# ntl.all == add x0, x0, x5 | ||
add x0, x0, x2 | ||
sb s11, 0(t0) | ||
add x0, x0, x3 | ||
sb s11, 2(t0) | ||
add x0, x0, x4 | ||
sb s11, 4(t0) | ||
add x0, x0, x5 | ||
sb s11, 6(t0) | ||
|
||
# c.ntl.p1 == c.add x0, x2 | ||
# c.ntl.pall == c.add x0, x3 | ||
# c.ntl.s1 == c.add x0, x4 | ||
# c.ntl.all == c.add x0, x5 | ||
.option push | ||
.option arch, +zca | ||
c.add x0, x2 | ||
sb s11, 8(t0) | ||
c.add x0, x3 | ||
sb s11, 10(t0) | ||
c.add x0, x4 | ||
sb s11, 12(t0) | ||
c.add x0, x5 | ||
sb s11, 14(t0) | ||
.option pop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#as: -march=rv32i_zihintntl | ||
#source: zihintntl.s | ||
#objdump: -d -M no-aliases | ||
|
||
.*:[ ]+file format .* | ||
|
||
Disassembly of section .text: | ||
|
||
0+000 <target>: | ||
[ ]+[0-9a-f]+:[ ]+00200033[ ]+ntl\.p1 | ||
[ ]+[0-9a-f]+:[ ]+01b28023[ ]+sb[ ]+s11,0\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+00300033[ ]+ntl\.pall | ||
[ ]+[0-9a-f]+:[ ]+01b28123[ ]+sb[ ]+s11,2\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+00400033[ ]+ntl\.s1 | ||
[ ]+[0-9a-f]+:[ ]+01b28223[ ]+sb[ ]+s11,4\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+00500033[ ]+ntl\.all | ||
[ ]+[0-9a-f]+:[ ]+01b28323[ ]+sb[ ]+s11,6\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+900a[ ]+c\.ntl\.p1 | ||
[ ]+[0-9a-f]+:[ ]+01b28023[ ]+sb[ ]+s11,0\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+900e[ ]+c\.ntl\.pall | ||
[ ]+[0-9a-f]+:[ ]+01b28123[ ]+sb[ ]+s11,2\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+9012[ ]+c\.ntl\.s1 | ||
[ ]+[0-9a-f]+:[ ]+01b28223[ ]+sb[ ]+s11,4\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+9016[ ]+c\.ntl\.all | ||
[ ]+[0-9a-f]+:[ ]+01b28323[ ]+sb[ ]+s11,6\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+900a[ ]+c\.ntl\.p1 | ||
[ ]+[0-9a-f]+:[ ]+01b28423[ ]+sb[ ]+s11,8\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+900e[ ]+c\.ntl\.pall | ||
[ ]+[0-9a-f]+:[ ]+01b28523[ ]+sb[ ]+s11,10\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+9012[ ]+c\.ntl\.s1 | ||
[ ]+[0-9a-f]+:[ ]+01b28623[ ]+sb[ ]+s11,12\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+9016[ ]+c\.ntl\.all | ||
[ ]+[0-9a-f]+:[ ]+01b28723[ ]+sb[ ]+s11,14\(t0\) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#as: -march=rv32i_zihintntl | ||
#objdump: -d | ||
|
||
.*:[ ]+file format .* | ||
|
||
Disassembly of section .text: | ||
|
||
0+000 <target>: | ||
[ ]+[0-9a-f]+:[ ]+00200033[ ]+ntl\.p1 | ||
[ ]+[0-9a-f]+:[ ]+01b28023[ ]+sb[ ]+s11,0\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+00300033[ ]+ntl\.pall | ||
[ ]+[0-9a-f]+:[ ]+01b28123[ ]+sb[ ]+s11,2\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+00400033[ ]+ntl\.s1 | ||
[ ]+[0-9a-f]+:[ ]+01b28223[ ]+sb[ ]+s11,4\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+00500033[ ]+ntl\.all | ||
[ ]+[0-9a-f]+:[ ]+01b28323[ ]+sb[ ]+s11,6\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+900a[ ]+ntl\.p1 | ||
[ ]+[0-9a-f]+:[ ]+01b28023[ ]+sb[ ]+s11,0\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+900e[ ]+ntl\.pall | ||
[ ]+[0-9a-f]+:[ ]+01b28123[ ]+sb[ ]+s11,2\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+9012[ ]+ntl\.s1 | ||
[ ]+[0-9a-f]+:[ ]+01b28223[ ]+sb[ ]+s11,4\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+9016[ ]+ntl\.all | ||
[ ]+[0-9a-f]+:[ ]+01b28323[ ]+sb[ ]+s11,6\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+900a[ ]+ntl\.p1 | ||
[ ]+[0-9a-f]+:[ ]+01b28423[ ]+sb[ ]+s11,8\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+900e[ ]+ntl\.pall | ||
[ ]+[0-9a-f]+:[ ]+01b28523[ ]+sb[ ]+s11,10\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+9012[ ]+ntl\.s1 | ||
[ ]+[0-9a-f]+:[ ]+01b28623[ ]+sb[ ]+s11,12\(t0\) | ||
[ ]+[0-9a-f]+:[ ]+9016[ ]+ntl\.all | ||
[ ]+[0-9a-f]+:[ ]+01b28723[ ]+sb[ ]+s11,14\(t0\) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.macro INSN_SEQ | ||
ntl.p1 | ||
sb s11, 0(t0) | ||
ntl.pall | ||
sb s11, 2(t0) | ||
ntl.s1 | ||
sb s11, 4(t0) | ||
ntl.all | ||
sb s11, 6(t0) | ||
.endm | ||
|
||
.macro INSN_SEQ_C | ||
c.ntl.p1 | ||
sb s11, 8(t0) | ||
c.ntl.pall | ||
sb s11, 10(t0) | ||
c.ntl.s1 | ||
sb s11, 12(t0) | ||
c.ntl.all | ||
sb s11, 14(t0) | ||
.endm | ||
|
||
target: | ||
INSN_SEQ # RV32I_Zihintntl | ||
|
||
# 'Zcb' is chosen to test complex cases to enable | ||
# compressed instructions. | ||
.option push | ||
.option arch, +zcb | ||
INSN_SEQ # RV32I_Zihintntl_Zca_Zcb (auto compression without prefix) | ||
INSN_SEQ_C # RV32I_Zihintntl_Zca_Zcb (with compressed prefix) | ||
.option pop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters