This is an archive of the discontinued LLVM Phabricator instance.

[docs] Add a RISC-V Usage page
ClosedPublic

Authored by reames on Aug 31 2022, 3:38 PM.

Details

Summary

This follows the pattern set by e.g. SPIR-V, AMDGPU, and WebAssembly.

For the moment, this page is fairly minimal stub. I mostly want a place to record which extensions we support, and when that support is not complete, a central place to note that. I'm deliberately starting with a subset of extensions which are pretty straight forward with only one case needing a detail note.

I figure the partial support cases are going to need a bunch of discussion, and having each of them in their own review seemed worthwhile. Similarly, the experimental extensions probably fall into the same bucket of triggering a bunch of review discussion.

Diff Detail

Event Timeline

reames created this revision.Aug 31 2022, 3:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2022, 3:38 PM
reames requested review of this revision.Aug 31 2022, 3:38 PM
reames updated this revision to Diff 457119.Aug 31 2022, 3:48 PM

Fix a couple minor formatting mistakes

jrtc27 added inline comments.Aug 31 2022, 3:54 PM
llvm/docs/RISCVUsage.rst
29–30

Too much time spent with RVV?...

52

I don't believe so?

54

.. ish, the CSRs are there but we're still at I2P0 so Zicsr doesn't really exist

55

ditto

craig.topper added inline comments.Aug 31 2022, 4:07 PM
llvm/docs/RISCVUsage.rst
60

Zve32x and Zve32f are supported as long as used with Zvl64b or larger

74

bytes -> bits

Thanks for doing this!

llvm/docs/RISCVUsage.rst
3

RISC-V

73

Maybe have these back-ticked for consistency?

asb added a comment.EditedSep 1 2022, 5:57 AM

Thanks for kicking this off - it's a great idea! I left a few notes inline. One thing I'm wondering about is what level of information it might be useful to give beyond just "supported". It might for instance be useful to indicate whether support is just at the MC layer or MC layer + codegen. If we were to do so, would just having a "codegen" category that encompasses automatic ISel as well as intrinsics where relevant be sufficient (I think so?).

[EDIT: and sorry for not fully processing your description about leaving off the "less straightforward" extensions prior to submitting comments]

llvm/docs/RISCVUsage.rst
19

I think RV32E is typically described as a base instruction set too (albeit one that is actually a subset of RV32I).

54

Plus Zicbop, Zicboz, Zicbom

59

Also Zbkb, Zbkc, Zbkx. MC layer support for Zfinx/Zdinx too

Plus various Zk* extensions.

eopXD added a subscriber: eopXD.Sep 1 2022, 6:30 AM
kito-cheng added inline comments.Sep 1 2022, 6:31 AM
llvm/docs/RISCVUsage.rst
65

Maybe mark as MC-layer only?

reames marked 2 inline comments as done.Sep 1 2022, 9:04 AM
reames added inline comments.
llvm/docs/RISCVUsage.rst
19

Do we support RV32E? You're right that this seems to be a base instruction set. If we do support it, how do we name that argument wise?

For now, I updated the text to indicate we didn't support RV32E, but I'm unsure if this is correct.

29–30

Apparently, good catch.

52

I'm unclear. I thought it was supported, but hadn't investigated in detail. Removed for now, will move to future patch.

54

@jrtc27 I don't follow your comment here. For the moment, I'm going to remove these.

@asb I'd deliberately left those out for the moment as I wasn't sure if the C intrinsics were implemented. I'll add in a follow on patch once I've double checked.

55

@jrtc27 Moved to follow up. I'd checked this one and thought we did support IFENCE, but maybe I was mistaken.

59

Let's do these in follow up patches.

65

Is it even supported by assembler? It could be, but I hadn't thought to check.

reames updated this revision to Diff 457295.Sep 1 2022, 9:04 AM

Address review comments - mostly by subsetting

kito-cheng added inline comments.Sep 2 2022, 2:22 AM
llvm/docs/RISCVUsage.rst
19

RV32E is supported in MC-layer[1] but not CodeGen[2], and we have RV64E ISA[2] now, that should be worth to mention that we are not support that here.

[1] https://reviews.llvm.org/D59470
[2] https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/RISCV/RISCVISelLowering.cpp#L53
[2] https://github.com/riscv/riscv-isa-manual/commit/b5f94a845760af00ff2743dd9f2269fd68236576

65

Zvl32b isn't define any instruction or CSRs, just a information about the VLEN is larger than 32 bits.

reames updated this revision to Diff 457602.Sep 2 2022, 8:18 AM

Address Kito's comments.

Are you going make a distinction between support on trunk and shipped with LLVM15?

reames added a comment.Sep 2 2022, 8:58 AM

Are you going make a distinction between support on trunk and shipped with LLVM15?

Docs always follow a release branch with the default being ToT. So, effectively LLVM 15 will not have this page, LLVM 16 will.

If you have specific extensions where documenting support isn't available in the 15 release, point them out. We might add text on a case by case basis.

llvm/docs/RISCVUsage.rst
19

I'll add in the RV32E bit - thanks for the links.

I'm not going to add RV64E as that's not yet in a ratified version of the specification. We can consider adding it under experimental once we have in tree code for it.

reames added a comment.Sep 6 2022, 8:27 AM

Anything holding this back? I'd like to get it in so that we can build off it.

craig.topper added inline comments.Sep 6 2022, 9:42 AM
llvm/docs/RISCVUsage.rst
71

Why does this stop at 1024?

reames added inline comments.Sep 6 2022, 9:48 AM
llvm/docs/RISCVUsage.rst
73

Because the table in the spec stopped at 1024, and I skimmed over the "Longer vector length extensions should follow the same pattern. wording. Will update to add the others.

reames updated this revision to Diff 458197.Sep 6 2022, 9:51 AM

Add missing ZvlNb variants.

craig.topper added inline comments.Sep 6 2022, 9:55 AM
llvm/docs/RISCVUsage.rst
73

Doesn't it go to Zvl65536b?

79

dissambler -> disassembler

reames updated this revision to Diff 458208.Sep 6 2022, 10:26 AM
reames updated this revision to Diff 458209.
reames added inline comments.
llvm/docs/RISCVUsage.rst
74

16k, 64k, what's the difference? Thanks for catching, apparently my brain hasn't returned from the long weekend yet.

Do we need a link from the main documentation to this page?

reames updated this revision to Diff 458228.Sep 6 2022, 11:32 AM
This revision is now accepted and ready to land.Sep 6 2022, 11:59 AM
This revision was landed with ongoing or failed builds.Sep 6 2022, 12:12 PM
This revision was automatically updated to reflect the committed changes.