-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add branching immediate instructions, and GAS tests
Signed-off-by: Nazareno Bruschi <[email protected]> Remove hardcoded address in xcvbi testcases Author: @linsinan1995 Immediate Branching Version 2 Instructions and Tests Encodings Updated include/opcode: * riscv-opc.h: Added corresponding MATCH and MASK macros for Immediate Branching. gas/testsuite/gas/riscv: * gas/testsuite/gas/riscv/cv-bi-beqimm.d * gas/testsuite/gas/riscv/cv-bi-bneimm.d * gas/testsuite/gas/riscv/cv-bi-march-rv32i-xcorev.d Signed-off-by: Nandni Jamnadas <[email protected]> tests
- Loading branch information
Showing
35 changed files
with
290 additions
and
3 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 |
---|---|---|
@@ -1,3 +1,14 @@ | ||
2021-08-10 Nazareno Bruschi <[email protected]> | ||
|
||
* config/tc-riscv.c (riscv_multi_subset_supports): Add immediate | ||
branching instruction class. | ||
(validate_riscv_insn, riscv_ip): Rename macro | ||
ENCODE_CV_ALU_UIMM5 -> ENCODE_CV_UIMM5. | ||
(validate_riscv_insn, riscv_ip): Add immediate branching | ||
operand and modify PC-relative offset operand. | ||
* doc/c-riscv.texi: Add details on CORE-V immediate | ||
branching ops ISA options. | ||
|
||
2021-08-06 Enrico Tabanelli <[email protected]> | ||
|
||
* config/tc-riscv.c (riscv_multi_subset_supports): Add | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
2021-08-10 Nazareno Bruschi <[email protected]> | ||
|
||
* gas/riscv/cv-bi-beqimm.d: Add immediate branching test. | ||
* gas/riscv/cv-bi-beqimm.s: Likewise. | ||
* gas/riscv/cv-bi-bneimm.d: Likewise. | ||
* gas/riscv/cv-bi-bneimm.s: Likewise. | ||
* gas/riscv/cv-bi-fail-march.d: Likewise. | ||
* gas/riscv/cv-bi-fail-march.l: Likewise. | ||
* gas/riscv/cv-bi-fail-march.s: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-01.d: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-01.l: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-01.s: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-02.d: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-02.l: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-02.s: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-03.d: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-03.l: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-03.s: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-04.d: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-04.l: Likewise. | ||
* gas/riscv/cv-bi-fail-operand-04.s: Likewise. | ||
* gas/riscv/cv-bi-march-rv32i-xcorev.d: Likewise. | ||
* gas/riscv/cv-bi-march-rv32i-xcorev.s: Likewise. | ||
|
||
2021-08-06 Enrico Tabanelli <[email protected]> | ||
|
||
* gas/riscv/cv-mem-fail-operand-01.d: Add post-increment | ||
|
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,12 @@ | ||
#as: -march=rv32i_xcvbi | ||
#objdump: -d | ||
|
||
.*:[ ]+file format .* | ||
|
||
|
||
Disassembly of section .text: | ||
|
||
0+000 <foo>: | ||
[ ]+0:[ ]+0102e00b[ ]+cv.beqimm[ ]+t0,-16,0 +<foo> | ||
[ ]+4:[ ]+fe5eee8b[ ]+cv.beqimm[ ]+t4,5,0 +<foo> | ||
[ ]+8:[ ]+fef3ec8b[ ]+cv.beqimm[ ]+t2,15,0 +<foo> |
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,4 @@ | ||
foo: | ||
cv.beqimm t0, -16, foo | ||
cv.beqimm t4, 5, foo | ||
cv.beqimm t2, 15, foo |
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,12 @@ | ||
#as: -march=rv32i_xcvbi | ||
#objdump: -d | ||
|
||
.*:[ ]+file format .* | ||
|
||
|
||
Disassembly of section .text: | ||
|
||
0+000 <foo>: | ||
[ ]+0:[ ]+0102f00b[ ]+cv.bneimm[ ]+t0,-16,0 +<foo> | ||
[ ]+4:[ ]+fe5efe8b[ ]+cv.bneimm[ ]+t4,5,0 +<foo> | ||
[ ]+8:[ ]+fef3fc8b[ ]+cv.bneimm[ ]+t2,15,0 +<foo> |
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,4 @@ | ||
foo: | ||
cv.bneimm t0, -16, foo | ||
cv.bneimm t4, 5, foo | ||
cv.bneimm t2, 15, foo |
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,3 @@ | ||
#as: -march=rv32i | ||
#source: cv-bi-fail-march.s | ||
#error_output: cv-bi-fail-march.l |
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,3 @@ | ||
.*: Assembler messages: | ||
.*: Error: unrecognized opcode `cv.beqimm t2,1,foo', extension `xcvbi' required | ||
.*: Error: unrecognized opcode `cv.bneimm t2,1,foo', extension `xcvbi' required |
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,5 @@ | ||
# Absence of xcorev or xcorevbi march option disables all CORE-V | ||
# immediate branching extensions. | ||
foo: | ||
cv.beqimm t2, 1, foo | ||
cv.bneimm t2, 1, foo |
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,3 @@ | ||
#as: -march=rv32i_xcvbi | ||
#source: cv-bi-fail-operand-01.s | ||
#error_output: cv-bi-fail-operand-01.l |
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,3 @@ | ||
.*: Assembler messages: | ||
.*: Error: illegal operands `cv.beqimm 20,10,foo' | ||
.*: Error: illegal operands `cv.bneimm 8,-4,foo' |
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,4 @@ | ||
# Comparison target must be a register | ||
foo: | ||
cv.beqimm 20, 10, foo | ||
cv.bneimm 8, -4, foo |
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,3 @@ | ||
#as: -march=rv32i_xcvbi | ||
#source: cv-bi-fail-operand-02.s | ||
#error_output: cv-bi-fail-operand-02.l |
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,3 @@ | ||
.*: Assembler messages: | ||
.*: Error: instruction cv.beqimm requires absolute expression | ||
.*: Error: instruction cv.bneimm requires absolute expression |
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,4 @@ | ||
# Comparison value must be an immediate | ||
foo: | ||
cv.beqimm t0, t1, foo | ||
cv.bneimm t3, t4, foo |
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,3 @@ | ||
#as: -march=rv32i_xcvbi | ||
#source: cv-bi-fail-operand-03.s | ||
#error_output: cv-bi-fail-operand-03.l |
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,9 @@ | ||
.*: Assembler messages: | ||
.*: Error: immediate value must be 5-bit signed, -17 is out of range | ||
.*: Error: immediate value must be 5-bit signed, -32 is out of range | ||
.*: Error: immediate value must be 5-bit signed, 16 is out of range | ||
.*: Error: immediate value must be 5-bit signed, 44 is out of range | ||
.*: Error: immediate value must be 5-bit signed, -17 is out of range | ||
.*: Error: immediate value must be 5-bit signed, -32 is out of range | ||
.*: Error: immediate value must be 5-bit signed, 16 is out of range | ||
.*: Error: immediate value must be 5-bit signed, 44 is out of range |
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,10 @@ | ||
# Comparison value must be an immediate in range [-16, +15] | ||
foo: | ||
cv.beqimm t0, -17, foo | ||
cv.beqimm t2, -32, foo | ||
cv.beqimm t4, 16, foo | ||
cv.beqimm t3, 44, foo | ||
cv.bneimm t0, -17, foo | ||
cv.bneimm t2, -32, foo | ||
cv.bneimm t4, 16, foo | ||
cv.bneimm t3, 44, foo |
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,11 @@ | ||
#as: -march=rv32i_xcvbi | ||
#objdump: -d | ||
|
||
.*:[ ]+file format .* | ||
|
||
|
||
Disassembly of section .text: | ||
|
||
0+000 <foo>: | ||
[ ]+0:[ ]+0013e00b[ ]+cv.beqimm[ ]+t2,1,0 +<foo> | ||
[ ]+4:[ ]+ff02fe8b[ ]+cv.bneimm[ ]+t0,-16,0 +<foo> |
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,4 @@ | ||
# xcorev march option works for all CORE-V immediate branching extensions | ||
foo: | ||
cv.beqimm t2, 1, foo | ||
cv.bneimm t0, -16, foo |
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 |
---|---|---|
@@ -1,3 +1,13 @@ | ||
2021-08-10 Nazareno Bruschi <[email protected]> | ||
|
||
* opcode/riscv-opc.h: Add immediate branching matches and | ||
masks. | ||
* opcode/riscv.h (riscv_insn_class, EXTRACT_CV_BI_IMM5): | ||
Add immediate branching class and macros for 5-bit signed | ||
immediate. | ||
(ENCODE_CV_ALU_UIMM5): Rename macro as ENCODE_CV_UIMM5. | ||
(RV_IMM_SIGN_N): Add macro for general sign extraction. | ||
|
||
2021-08-06 Enrico Tabanelli <[email protected]> | ||
|
||
* riscv-opc.h: Add post-increment and register-indexed | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
2021-08-23 Lin Sinan <[email protected]> | ||
|
||
* ld-riscv-elf/cv-bi-beqimm.d: Remove hard coded address. | ||
* ld-riscv-elf/cv-bi-bneimm.d: Likewise. | ||
* ld-riscv-elf/cv-hwlp-starti.d: Likewise. | ||
* ld-riscv-elf/cv-hwlp-endi.d: Likewise. | ||
* ld-riscv-elf/cv-hwlp-setupi.d: Likewise. | ||
* ld-riscv-elf/cv-hwlp-setup.d: Likewise. | ||
|
||
2021-08-10 Nazareno Bruschi <[email protected]> | ||
|
||
* ld-riscv-elf/cv-bi-beqimm.d: Add new test. | ||
* ld-riscv-elf/cv-bi-beqimm.s: Likewise. | ||
* ld-riscv-elf/cv-bi-bneimm.d: Likewise. | ||
* ld-riscv-elf/cv-bi-bneimm.s: Likewise. | ||
* ld-riscv-elf/ld-riscv-elf.exp: Add CORE-V immediate | ||
branching tests. | ||
|
||
2021-08-23 Jessica Mills <[email protected]> | ||
|
||
* ld-riscv-elf/ld-riscv-elf.exp: Renamed CORE-V hwlp tests to match | ||
|
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,21 @@ | ||
#name: beqimm relocation | ||
#source: cv-bi-beqimm.s | ||
#as: -march=rv32i_xcvbi | ||
#ld: -melf32lriscv | ||
#objdump: -dr | ||
|
||
.*: file format .* | ||
|
||
|
||
Disassembly of section \.text: | ||
|
||
.* <func>: | ||
.*:[[:space:]]+00008067[[:space:]]+ret | ||
|
||
.* <_start>: | ||
.*:[[:space:]]+0102e40b[[:space:]]+cv.beqimm[[:space:]]+t0,-16,.*[[:space:]]+<L2> | ||
.*:[[:space:]]+ff9ff0ef[[:space:]]+jal[[:space:]]+10074[[:space:]]+<func> | ||
|
||
.* <L2>: | ||
.*:[[:space:]]+00000013[[:space:]]+nop | ||
#pass |
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,11 @@ | ||
.option nopic | ||
.text | ||
.align 1 | ||
.globl _start | ||
.type _start, @function | ||
|
||
func: ret | ||
_start: | ||
cv.beqimm t0, -16, L2 | ||
call func | ||
L2: nop |
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,21 @@ | ||
#name: bneimm relocation | ||
#source: cv-bi-bneimm.s | ||
#as: -march=rv32i_xcvbi | ||
#ld: -melf32lriscv | ||
#objdump: -dr | ||
|
||
.*: file format .* | ||
|
||
|
||
Disassembly of section \.text: | ||
|
||
.* <func>: | ||
.*:[[:space:]]+00008067[[:space:]]+ret | ||
|
||
.* <_start>: | ||
.*:[[:space:]]+0102f40b[[:space:]]+cv.bneimm[[:space:]]+t0,-16,.*[[:space:]]+<L2> | ||
.*:[[:space:]]+ff9ff0ef[[:space:]]+jal[[:space:]]+10074[[:space:]]+<func> | ||
|
||
.* <L2>: | ||
.*:[[:space:]]+00000013[[:space:]]+nop | ||
#pass |
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,11 @@ | ||
.option nopic | ||
.text | ||
.align 1 | ||
.globl _start | ||
.type _start, @function | ||
|
||
func: ret | ||
_start: | ||
cv.bneimm t0, -16, L2 | ||
call func | ||
L2: nop |
Oops, something went wrong.