-
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: Non-standard encodings of `fence' (disasm)
This commit adds disassembler support for non-standard encodings of the `fence' instruction. Despite that those fields are reserved in many cases, base implementation shall ignore and handle with fm=0000. gas/ChangeLog: * config/tc-riscv.c (validate_riscv_insn): Add ignored fm field. (riscv_ip): Add ignored fm field. * testsuite/gas/riscv/fence-dis-nonstd.s: New disasm test. * testsuite/gas/riscv/fence-dis-nonstd.d: Likewise. include/ChangeLog: * opcode/riscv.h (OP_MASK_FM, OP_SH_FM): New. opcodes/ChangeLog: * riscv-dis.c (print_insn_args): Add ignored fm field. * riscv-opc.c (riscv_opcodes): Reorder `fence.tso' so that reserved `fence' instruction entry is matched at the end. Ignore reserved bit positions.
- Loading branch information
Showing
5 changed files
with
47 additions
and
2 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,20 @@ | ||
#as: -march=rv32i | ||
#source: fence-dis-nonstd.s | ||
#objdump: -dr | ||
|
||
.*:[ ]+file format .* | ||
|
||
|
||
Disassembly of section .text: | ||
|
||
0+000 <target>: | ||
[ ]+[0-9a-f]+:[ ]+0ff0000f[ ]+fence | ||
[ ]+[0-9a-f]+:[ ]+8330000f[ ]+fence\.tso | ||
[ ]+[0-9a-f]+:[ ]+0ff0000f[ ]+fence | ||
[ ]+[0-9a-f]+:[ ]+8330000f[ ]+fence\.tso | ||
[ ]+[0-9a-f]+:[ ]+0cf00f8f[ ]+fence[ ]+io,iorw | ||
[ ]+[0-9a-f]+:[ ]+0fcf800f[ ]+fence[ ]+iorw,io | ||
[ ]+[0-9a-f]+:[ ]+83300f8f[ ]+fence\.tso | ||
[ ]+[0-9a-f]+:[ ]+833f800f[ ]+fence\.tso | ||
[ ]+[0-9a-f]+:[ ]+8ff0000f[ ]+fence[ ]+iorw,iorw | ||
[ ]+[0-9a-f]+:[ ]+1330000f[ ]+fence[ ]+rw,rw |
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,20 @@ | ||
target: | ||
fence | ||
fence.tso | ||
# Standard encodings of fence and fence.tso | ||
.insn i MISC_MEM, 0, x0, x0, 0x0ff | ||
.insn i MISC_MEM, 0, x0, x0, 0x833-0x1000 | ||
# Non-standard encodings (regular, either RD or RS1 are non-zero) | ||
# Ignore unused bit fields. | ||
.insn i MISC_MEM, 0, x31, x0, 0x0cf | ||
.insn i MISC_MEM, 0, x0, x31, 0x0fc | ||
# Non-standard encodings (TSO, either RD or RS1 are non-zero) | ||
# Ignore unused bit fields for fence.tso. | ||
.insn i MISC_MEM, 0, x31, x0, 0x833-0x1000 | ||
.insn i MISC_MEM, 0, x0, x31, 0x833-0x1000 | ||
# Non-standard encoding (TSO, pred and succ are not defined) | ||
# Since fm+pred+succ is not defined, fallback to regular fence. | ||
.insn i MISC_MEM, 0, x0, x0, 0x8ff-0x1000 | ||
# Non-standard encoding (fm is reserved) | ||
# Fallback to regular fence. | ||
.insn i MISC_MEM, 0, x0, x0, 0x133 |
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