-
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.
UNRATIFIED RISC-V: Add support for 'Zabha' subword AMO extension
[DO NOT MERGE] Until this extension is frozen/ratified and final version number is determined, this patch should not be merged upstream. This commit uses unratified version 0.9 as in the latest release tag: <https://github.com/riscv/riscv-zabha/releases/tag/v0.9> This commit adds support for the 'Zabha' extension, adding subword (byte and half) AMO instructions. This is based on the latest commit: <riscv/riscv-zabha@810f0ee> bfd/ChangeLog: * elfxx-riscv.c (riscv_implicit_subsets): Make 'Zabha' to imply 'A' extension. (riscv_supported_std_z_ext): Add 'Zabha' to the supported list. (riscv_multi_subset_supports, riscv_multi_subset_supports_ext): Add handling for new instruction classes. gas/ChangeLog: * testsuite/gas/riscv/zabha.s: New test. * testsuite/gas/riscv/zabha.d: Likewise. * testsuite/gas/riscv/zabha-zacas.s: New test. * testsuite/gas/riscv/zabha-zacas.d: Likewise. include/ChangeLog: * opcode/riscv-opc.h (MATCH_AMOADD_B, MASK_AMOADD_B, MATCH_AMOADD_H, MASK_AMOADD_H, MATCH_AMOAND_B, MASK_AMOAND_B, MATCH_AMOAND_H, MASK_AMOAND_H, MATCH_AMOMAX_B, MASK_AMOMAX_B, MATCH_AMOMAX_H, MASK_AMOMAX_H, MATCH_AMOMAXU_B, MASK_AMOMAXU_B, MATCH_AMOMAXU_H, MASK_AMOMAXU_H, MATCH_AMOMIN_B, MASK_AMOMIN_B, MATCH_AMOMIN_H, MASK_AMOMIN_H, MATCH_AMOMINU_B, MASK_AMOMINU_B, MATCH_AMOMINU_H, MASK_AMOMINU_H, MATCH_AMOOR_B, MASK_AMOOR_B, MATCH_AMOOR_H, MASK_AMOOR_H, MATCH_AMOSWAP_B, MASK_AMOSWAP_B, MATCH_AMOSWAP_H, MASK_AMOSWAP_H, MATCH_AMOXOR_B, MASK_AMOXOR_B, MATCH_AMOXOR_H, MASK_AMOXOR_H, MATCH_AMOCAS_B, MASK_AMOCAS_B, MATCH_AMOCAS_H, MASK_AMOCAS_H): New. * opcode/riscv.h (enum riscv_insn_class): Add new instruction classes INSN_CLASS_ZABHA and INSN_CLASS_ZABHA_AND_ZACAS. opcodes/ChangeLog: * riscv-opc.c (riscv_opcodes): Add subword AMO instructions.
- Loading branch information
Showing
8 changed files
with
343 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,17 @@ | ||
#as: -march=rv32i_zabha_zacas | ||
#objdump: -d | ||
|
||
.*:[ ]+file format .* | ||
|
||
|
||
Disassembly of section .text: | ||
|
||
0+000 <target>: | ||
[ ]+[0-9a-f]+:[ ]+28c5852f[ ]+amocas\.b[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+2cc5852f[ ]+amocas\.b\.aq[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+2ac5852f[ ]+amocas\.b\.rl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+2ec5852f[ ]+amocas\.b\.aqrl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+28c5952f[ ]+amocas\.h[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+2cc5952f[ ]+amocas\.h\.aq[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+2ac5952f[ ]+amocas\.h\.rl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+2ec5952f[ ]+amocas\.h\.aqrl[ ]+a0,a2,\(a1\) |
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 @@ | ||
target: | ||
amocas.b a0, a2, (a1) | ||
amocas.b.aq a0, a2, (a1) | ||
amocas.b.rl a0, a2, (a1) | ||
amocas.b.aqrl a0, a2, (a1) | ||
amocas.h a0, a2, (a1) | ||
amocas.h.aq a0, a2, (a1) | ||
amocas.h.rl a0, a2, (a1) | ||
amocas.h.aqrl a0, a2, (a1) |
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,81 @@ | ||
#as: -march=rv32i_zabha | ||
#objdump: -d | ||
|
||
.*:[ ]+file format .* | ||
|
||
|
||
Disassembly of section .text: | ||
|
||
0+000 <target>: | ||
[ ]+[0-9a-f]+:[ ]+08c5852f[ ]+amoswap\.b[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+0cc5852f[ ]+amoswap\.b\.aq[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+0ac5852f[ ]+amoswap\.b\.rl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+0ec5852f[ ]+amoswap\.b\.aqrl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+00c5852f[ ]+amoadd\.b[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+04c5852f[ ]+amoadd\.b\.aq[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+02c5852f[ ]+amoadd\.b\.rl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+06c5852f[ ]+amoadd\.b\.aqrl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+20c5852f[ ]+amoxor\.b[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+24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+amomin\.h\.aqrl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+a0c5952f[ ]+amomax\.h[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+a4c5952f[ ]+amomax\.h\.aq[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+a2c5952f[ ]+amomax\.h\.rl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+a6c5952f[ ]+amomax\.h\.aqrl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+c0c5952f[ ]+amominu\.h[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+c4c5952f[ ]+amominu\.h\.aq[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+c2c5952f[ ]+amominu\.h\.rl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+c6c5952f[ ]+amominu\.h\.aqrl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+e0c5952f[ ]+amomaxu\.h[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+e4c5952f[ ]+amomaxu\.h\.aq[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+e2c5952f[ ]+amomaxu\.h\.rl[ ]+a0,a2,\(a1\) | ||
[ ]+[0-9a-f]+:[ ]+e6c5952f[ ]+amomaxu\.h\.aqrl[ ]+a0,a2,\(a1\) |
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,73 @@ | ||
target: | ||
amoswap.b a0, a2, (a1) | ||
amoswap.b.aq a0, a2, (a1) | ||
amoswap.b.rl a0, a2, (a1) | ||
amoswap.b.aqrl a0, a2, (a1) | ||
amoadd.b a0, a2, (a1) | ||
amoadd.b.aq a0, a2, (a1) | ||
amoadd.b.rl a0, a2, (a1) | ||
amoadd.b.aqrl a0, a2, (a1) | ||
amoxor.b a0, a2, (a1) | ||
amoxor.b.aq a0, a2, (a1) | ||
amoxor.b.rl a0, a2, (a1) | ||
amoxor.b.aqrl a0, a2, (a1) | ||
amoand.b a0, a2, (a1) | ||
amoand.b.aq a0, a2, (a1) | ||
amoand.b.rl a0, a2, (a1) | ||
amoand.b.aqrl a0, a2, (a1) | ||
amoor.b a0, a2, (a1) | ||
amoor.b.aq a0, a2, (a1) | ||
amoor.b.rl a0, a2, (a1) | ||
amoor.b.aqrl a0, a2, (a1) | ||
amomin.b a0, a2, (a1) | ||
amomin.b.aq a0, a2, (a1) | ||
amomin.b.rl a0, a2, (a1) | ||
amomin.b.aqrl a0, a2, (a1) | ||
amomax.b a0, a2, (a1) | ||
amomax.b.aq a0, a2, (a1) | ||
amomax.b.rl a0, a2, (a1) | ||
amomax.b.aqrl a0, a2, (a1) | ||
amominu.b a0, a2, (a1) | ||
amominu.b.aq a0, a2, (a1) | ||
amominu.b.rl a0, a2, (a1) | ||
amominu.b.aqrl a0, a2, (a1) | ||
amomaxu.b a0, a2, (a1) | ||
amomaxu.b.aq a0, a2, (a1) | ||
amomaxu.b.rl a0, a2, (a1) | ||
amomaxu.b.aqrl a0, a2, (a1) | ||
amoswap.h a0, a2, (a1) | ||
amoswap.h.aq a0, a2, (a1) | ||
amoswap.h.rl a0, a2, (a1) | ||
amoswap.h.aqrl a0, a2, (a1) | ||
amoadd.h a0, a2, (a1) | ||
amoadd.h.aq a0, a2, (a1) | ||
amoadd.h.rl a0, a2, (a1) | ||
amoadd.h.aqrl a0, a2, (a1) | ||
amoxor.h a0, a2, (a1) | ||
amoxor.h.aq a0, a2, (a1) | ||
amoxor.h.rl a0, a2, (a1) | ||
amoxor.h.aqrl a0, a2, (a1) | ||
amoand.h a0, a2, (a1) | ||
amoand.h.aq a0, a2, (a1) | ||
amoand.h.rl a0, a2, (a1) | ||
amoand.h.aqrl a0, a2, (a1) | ||
amoor.h a0, a2, (a1) | ||
amoor.h.aq a0, a2, (a1) | ||
amoor.h.rl a0, a2, (a1) | ||
amoor.h.aqrl a0, a2, (a1) | ||
amomin.h a0, a2, (a1) | ||
amomin.h.aq a0, a2, (a1) | ||
amomin.h.rl a0, a2, (a1) | ||
amomin.h.aqrl a0, a2, (a1) | ||
amomax.h a0, a2, (a1) | ||
amomax.h.aq a0, a2, (a1) | ||
amomax.h.rl a0, a2, (a1) | ||
amomax.h.aqrl a0, a2, (a1) | ||
amominu.h a0, a2, (a1) | ||
amominu.h.aq a0, a2, (a1) | ||
amominu.h.rl a0, a2, (a1) | ||
amominu.h.aqrl a0, a2, (a1) | ||
amomaxu.h a0, a2, (a1) | ||
amomaxu.h.aq a0, a2, (a1) | ||
amomaxu.h.rl a0, a2, (a1) | ||
amomaxu.h.aqrl a0, a2, (a1) |
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
Oops, something went wrong.