You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments