-
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 tentative 'Zicntr' and 'Zihpm' support
This commit adds tentative support for 'Zicntr' and 'Zihpm' extensions. It is designed NOT to emit existence of 'Zicntr' and 'Zihpm' extensions to output files unless we specify those extensions with version number in the "-march" option. In a sense, those extensions are nearly transparent on supported ISAs (unless we explicitly touch them). This makes adopting this commit possible without actual ratification. bfd/ChangeLog: * elfxx-riscv.c (check_implicit_for_counters): New function for 'Zicntr' -> 'Zicsr' and 'Zihpm' -> 'Zicsr' implications. (riscv_implicit_subsets): Add implications for those extensions so that current "i" always assume both. (riscv_supported_std_z_ext): Add tentative 'Zicntr' and 'Zihpm' extensions with undetermined version numbers to prevent arch string emitting. (riscv_parse_add_subset): Add "zicntr" and "zihpm" to exceptions to recognize on older ISAs if there's no version number. (riscv_multi_subset_supports): Add support for 'Zicntr'. (riscv_multi_subset_supports_ext): Likewise. gas/ChangeLog: * config/tc-riscv.c (enum riscv_csr_class): Add CSR classes for 'Zicntr' and 'Zihpm' extensions. (riscv_csr_address): Add handling for new CSR classes. * testsuite/gas/riscv/march-imply-i.s: Add 'Zicntr' instructions. include/ChangeLog: * opcode/riscv-opc.h: Change CSR classes for counter CSRs. * opcode/riscv.h (enum riscv_insn_class): Add INSN_CLASS_ZICNTR for 'Zicntr' pseudoinstructions.
- Loading branch information
Showing
6 changed files
with
211 additions
and
163 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
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 |
---|---|---|
|
@@ -22,3 +22,11 @@ target: | |
|
||
# zifencei | ||
fence.i | ||
|
||
# zicntr | ||
rdcycle t0 | ||
rdtime t0 | ||
rdinstret t0 | ||
rdcycleh t0 | ||
rdtimeh t0 | ||
rdinstreth t0 |
Oops, something went wrong.