This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Accept zicntr and zihpm command line options
ClosedPublic

Authored by craig.topper on Feb 16 2023, 1:02 PM.

Details

Summary

This change adds the definition of the two extensions, but does not either a) make any register definitions conditional on them or b) enabled the extensions by default.

This is somewhat analogous to https://reviews.llvm.org/D143953, but with some key differences. The best discussion I can find on status is here: https://github.com/riscv/riscv-profiles/issues/43. These were removed between document version 2.1 and 2.2, but were not defined as new extensions in 2.2. That addition came later - in March 2022.

According to https://drive.google.com/file/d/1qa57pePesOiDOrNzxuuGFhCL4Rbi9AYB/view these were ratified in March 2023.

Diff Detail

Event Timeline

reames created this revision.Feb 16 2023, 1:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2023, 1:02 PM
reames requested review of this revision.Feb 16 2023, 1:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2023, 1:02 PM
asb added a comment.Feb 16 2023, 1:38 PM

One additional point to make is that we don't currently try to gate access to CSR names on extensions. Partly as when we started the vocabulary to do so wasn't always there. Partly as nobody was motivated to implement it and add all the necessary testing. I'm personally not sure it has a huge amount of value.

So I'm incredibly relaxed about accepting zicntr/zihpm in the kind of way this patch suggests once their status is clarified. Looks like the versioning questions was raised on the riscv-isa-manual repo too https://github.com/riscv/riscv-isa-manual/issues/976. The merged PR https://github.com/riscv/riscv-isa-manual/pull/859 includes clarifications to zicntr/zihpm "for ratification" which suggests the process at least started.

https://github.com/riscv/riscv-isa-manual/releases/tag/archive has an assortment of past specs, including the 2.2 you're after

reames edited the summary of this revision. (Show Details)Feb 23 2023, 12:04 PM

https://github.com/riscv/riscv-isa-manual/releases/tag/archive has an assortment of past specs, including the 2.2 you're after

Thanks! I dug through this and the repo commit history, and have updated the revision summary.

Tried to make a PR to adding version on ISA manual: https://github.com/riscv/riscv-isa-manual/pull/1008

Andrew Waterman clarified both extensions are 1.0 https://github.com/riscv/riscv-isa-manual/pull/1008

craig.topper commandeered this revision.Apr 21 2023, 11:27 AM
craig.topper edited reviewers, added: reames; removed: craig.topper.

Commandeering so I can rebase it.

craig.topper edited the summary of this revision. (Show Details)

Rebase

Rebase RISCVUsage.rst

Drop Predicate and AssemblerPredicate since they aren't used.

https://wiki.riscv.org/display/HOME/Recently+Ratified+Extensions says these were ratified in March 2023. I don't know if there's any other place it was announced to back that up.

craig.topper retitled this revision from [WIP][RISCV] Accept zicntr and zihpm command line options to [RISCV] Accept zicntr and zihpm command line options.Apr 25 2023, 12:54 PM
craig.topper edited the summary of this revision. (Show Details)
reames accepted this revision.Apr 26 2023, 7:20 AM

Sounds like we're unblocked from the RVI side, so LGTM.

This revision is now accepted and ready to land.Apr 26 2023, 7:20 AM
asb accepted this revision.Apr 26 2023, 7:37 AM

LGTM.

This revision was automatically updated to reflect the committed changes.