This is an archive of the discontinued LLVM Phabricator instance.

[docs][RISCV] Document experimental extensions
ClosedPublic

Authored by reames on Sep 2 2022, 9:05 AM.

Details

Summary

This adds a description of the currently existing experimental extensions. I took all information about versions and specifications from either the original commits, or current code. I'm not terribly familiar with any of these, so double checking my facts is much appreciated.

Diff Detail

Event Timeline

reames created this revision.Sep 2 2022, 9:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2022, 9:05 AM
reames requested review of this revision.Sep 2 2022, 9:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2022, 9:06 AM
sunshaoce added inline comments.Sep 4 2022, 8:12 AM
llvm/docs/RISCVUsage.rst
106

Zihintntl can be found in chapter 4 of riscv-isa-manual .

reames added inline comments.Sep 6 2022, 8:18 AM
llvm/docs/RISCVUsage.rst
106

Agreed, thanks for the link.

Do you happen to know if RVI has a convention for referring to unreleased version of the specification. I'd default to something like: "The 20220831 draft version of the X specification". (I definitely want a PDF, and not a link to the repo itself.)

kito-cheng added inline comments.Sep 6 2022, 8:24 AM
llvm/docs/RISCVUsage.rst
106

You can found pdf in github release page: https://github.com/riscv/riscv-isa-manual/releases

reames added inline comments.Sep 6 2022, 8:25 AM
llvm/docs/RISCVUsage.rst
106

I know, that wasn't my question.

reames updated this revision to Diff 458239.Sep 6 2022, 12:18 PM

Add zihintntl doc link and fix a couple typos.

frasercrmck added inline comments.Sep 6 2022, 11:52 PM
llvm/docs/RISCVUsage.rst
100

bitmanpip -> bitmanip

eopXD added a comment.Sep 7 2022, 12:45 AM

Maybe add description that says -menable-experimental-extensions is required to use them in Clang?

reames updated this revision to Diff 458530.EditedSep 7 2022, 12:23 PM

Address review comments and add recently landed Ztso experimental extension.

craig.topper added inline comments.Sep 7 2022, 8:50 PM
llvm/docs/RISCVUsage.rst
100

similiar -> similar

114

preceed -> precede. Though "prefix" might be better in this context?

reames updated this revision to Diff 458771.Sep 8 2022, 9:26 AM

Fix typos

asb accepted this revision.Sep 8 2022, 10:22 AM

LGTM in that I'd be happy for this to land as-is and to continue iterating in future reviews. I've left a couple of comments inline though.

llvm/docs/RISCVUsage.rst
97

Two thoughts here - if there's something you'd like to take from it in another revision of this patch that's great, but I'm also equally happy to land this as-is and continue work in follow-up patches.

I actually have a slightly different perspective on this. I think there's a second goal that is at least as important as supporting ratification, which is to help avoid duplicated or wasted effort on downstream forks and to avoid the problems (technical, potentially even licensing) that would ensue from later trying to merge a work from a long-lived downstream work that had been developed outside of LLVM's standard collaboration infrastructure and methodologies.

I'd maybe clarify that our policies on experimental extensions as they stand only apply to extensions that are understood to be on a path towards ratification as a standard extension. Perhaps changing "The decision on whether to accept an experimental extension is currently done on an entirely case by case basis, though as it stands we've only agreed a policy that allows accepting such extensions if they are understood to be on a path towards eventual ratification as a standard RISC-V extension."

In case you hadn't seen it, see here for more background.

This revision is now accepted and ready to land.Sep 8 2022, 10:22 AM
This revision was landed with ongoing or failed builds.Sep 8 2022, 12:30 PM
This revision was automatically updated to reflect the committed changes.
reames added inline comments.Sep 8 2022, 12:42 PM
llvm/docs/RISCVUsage.rst
97

This gets complicated. :)

In this review, I was specifically trying not to take a position on a couple of potentially controversial cases. I do think we need to incorporate these, but I figured some discussion at a sync call was probably warranted. I used the case by case wording to try to leave maximum flexibility until we'd had that conversation.

Case 1 - Extension on clear path to ratification. This is the easy case.

Case 2 - Extension which has stalled on path to ratification with no significant uptake. Ex: Several of the bitmanip variants. Maybe we want to consider extensions with alternatives different than those without?

Case 3 - Vendor extension which is "done" and exists in real hardware. Assume custom encoding space for this item.

Case 4 - In development vendor extensions which haven't yet shipped.

Case 5 - Experimental extension which isn't ratified, but is shipped by a vendor. With sub-cases for encodings chosen in the custom space, and overlapping the general space. (i.e. someone thought it was getting ratified and misjudged.)

Case 6 - Vendor has a hardware bug, and we have a defacto vendor extension which overlaps with generic encoding space and maybe even claims generic extension support. (Narrower in scope than 5, but probably the most annoying.)

My, not completely thought through, take is that we need to define a vendor extension policy, and then our stance on which experimental ones to accept gets broadened to include either on path to ratification or on path to vendor status.

p.s. Thanks for the link. I'd forgotten that. Most of the discussion seemed focus on the mechanics (which this change documents), as opposed to the boundaries on what we should accept. Unless I misread?

asb added inline comments.Sep 13 2022, 7:54 AM
llvm/docs/RISCVUsage.rst
97

You're right, the discussion was very focused on mechanics and on the very narrow topic of extensions believed to be on a path towards ratification. Extension being stuck in limbo (like a number of the bitmanip extensions) is also an eventuality that wasn't really considered.