159 Commits

Author SHA1 Message Date
David Spickett
b7ea2643ce [llvm][docs] Fix RISCVUsage docs build error
After changes in #109651.

Warning, treated as error:
/home/davspi01/work/open_source/llvm-project/llvm/docs/RISCVUsage.rst::Anonymous hyperlink mismatch: 1 references but 0 targets.

In typical RST fashion, all that was missing was a space between
the last word and the opening `<` of the link.
2024-09-25 10:21:45 +01:00
Alex Bradbury
614aeda93b
[RISCV] Mark Zacas as non-experimental (#109651)
The extension has been ratified for some time, but we kept it
experimental (see #99898) due to
<https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/444>. The
ABI issue has been resolved by #101023 so I believe there's no known
barrier to moving Zacas to non-experimental.
2024-09-25 06:14:43 +01:00
Sam Elliott
17a3bdb529 [RISCV][docs] Fix List Formatting 2024-09-17 04:50:45 -07:00
Craig Topper
aaa0f4d382
[RISCV][Docs] Remove Zvbb, Zvbc and Zvk* from experimental C intrinsics section of RISCVUsage.rst. NFC (#108718)
These are no longer experimental after
051054e6f74303bc880221e88671745f363964cc. I left the section because we
will be adding intrinsics for Zvkgs and Zvbc32e.
2024-09-16 11:12:09 -07:00
Sam Elliott
f0787edc5e [RISCV][docs] Explain Relaxation Default
As requested in follow-up comments on #108592.
2024-09-16 10:52:25 -07:00
Sam Elliott
76a85b0e2f
[RISCV][docs] GP Relaxation and Small Data Limit (#108592)
As discussed in this week's RISC-V sync-up, we said we would add
documentation about these options, and how they work.
2024-09-16 15:41:07 +01:00
Craig Topper
55ec015c4d [RISCV][Docs] Correct vector crypto note link spelling. NFC 2024-09-14 05:41:38 -07:00
Craig Topper
c6c3803b72
[RISCV] Add documentation that Zvbc and Zvk* are supported through intrinsics. NFC (#108577) 2024-09-13 16:31:44 -07:00
Craig Topper
1fc3ca1a12
[RISCV] Add Zvfhmin to RISCVUsage.rst. NFC (#108574) 2024-09-13 11:39:39 -07:00
Craig Topper
8e2843b471
[RISCV][Docs] Change Zvbb and Zvkb from 'Assembly Support' to Supported. NFC (#108572)
We have generic isel support for Zvkb and Zvbb.
2024-09-13 09:29:31 -07:00
Alex Bradbury
596e7ccd30
[RISCV][doc] Add note to RISCVUsage about supported atomics ABIs (#103879)
I've tried to avoid giving too much detailed explanation as the psABI docs are the
better source for this.
2024-09-11 10:04:56 +01:00
Craig Topper
0ca77f6656
[RISCV] Add CSRs and an instruction for Smctr and Ssctr extensions. (#105148)
https://github.com/riscv/riscv-control-transfer-records/releases/tag/v1.0_rc3
2024-08-21 19:23:07 -07:00
Shao-Ce SUN
bacedb5684
[RISCV] Remove experimental for Ssqosid ext (#105476)
Ratified: https://github.com/riscv/riscv-ssqosid/releases/tag/v1.0
2024-08-21 16:42:16 +08:00
Pengcheng Wang
a80a90e34b
[RISCV][MC] Support experimental extensions Zvbc32e and Zvkgs (#103709)
These two extensions add addtional instructions for carryless
multiplication with 32-bits elements and Vector-Scalar GCM
instructions.

Please see https://github.com/riscv/riscv-isa-manual/pull/1306.
2024-08-19 11:50:32 +08:00
Alex Bradbury
70e7d26e56
[RISCV] Mark zacas as experimental again due to unresolved ABI issue (#99898)
As discussed at the last sync-up call, mark Zacas as experimental until
this ABI issue is resolved
<https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/444>.

Don't return Zacas in getHostCPUFeatures (leaving a TODO there) as even if requesting detection of "native" features, the user likely doesn't want to automatically opt in to experimental codegen.
2024-07-23 08:06:15 +01:00
Yeting Kuo
58c7df90f8
[RISCV] Bump the version of Zicfilp/Zicfiss to 1.0 (#98891)
Both of them are ratified now.
https://wiki.riscv.org/display/HOME/Ratified+Extensions

This patch does not set them to non-experimental, since Zicfilp lacks
lld support and Zicfiss also lacks compiler-rt/libunwind support.
2024-07-16 14:38:08 +08:00
Jessica Clarke
8659c91b79
[RISCV][doc] Grammar fix
Fixes 884a07fee0ba36649561003e36d197323380f3d2
2024-07-15 21:09:29 +01:00
R
3c5f929ad0
[RISCV] Add QingKe "XW" compressed opcode extension (#97925)
This extension consists of 8 additional 16-bit compressed forms for
existing standard load/store opcodes.

These opcodes are found in some RISC-V microcontrollers from WCH /
Nanjing Qinheng Microelectronics.

As discussed in the Discourse forums, this uses incompatible extension
and opcode names vs the vendor binary toolchain. The chosen names
instead follow the conventions for other vendor extensions listed on the
"riscv-non-isa" project.
2024-07-11 11:10:02 +08:00
Alex Bradbury
884a07fee0
[RISCV][doc] Document profiles in RISCVUsage (#98326)
Just like we do for extensions, list those which are supported and those
that can be enabled with additional flags.
2024-07-10 15:43:18 +01:00
Philip Reames
90d79e258e Reapply "[RISCV] Remove experimental from Ztso. (#96465)"
This was reverted in f985a8826bfa4ca3d23e654185de35e30ea6dc79.  Since that,
the default WMO lowering has moved to A67 compatible, the ABI attribute
emission has landed (off by default), and the LLD change to merge said
attributes have landed.  Our ztso lowering is believed to also be A67
compatible, and no known issues remain.

Original commit message:

Ztso 1.0 was ratified in January 2023.
Documentation:
https://github.com/riscv/riscv-isa-manual/blob/main/src/ztso-st-ext.adoc
2024-07-09 10:45:56 -07:00
Jianjian Guan
3259768557
[RISCV] Remove experimental for bf16 extensions (#97996)
They are already ratified now.
2024-07-09 14:34:03 +08:00
Craig Topper
4e2e4856b7
[RISCV] Update SiFive VCIX documentation link. NFC (#96986)
The previous version of the document did not prefix the intrinsic names
with `__riscv_`. That has been corrected now. We have always implemented
the intrinsics with the `__riscv_` prefix so now the documentation
matches our implementation.

The document is now labeled as 1.1, but I have not changed the extension
version in the compiler since it was only changing the intrinsic names.
2024-06-28 12:49:20 -07:00
Michael Maitland
dade11f55e
[RISCV] Bump Pointer Masking extension version (#96715)
These extensions had their version number bumped and still experimental
(under public review). I didn't see anything in the [commit
history](https://github.com/riscv/riscv-j-extension/commits/master/)
since #79929 that would warrant a change to the implementation of
pointer masking in the compiler.
2024-06-27 11:42:05 -04:00
Philip Reames
f985a8826b Revert "[RISCV] Remove experimental from Ztso. (#96465)"
This reverts commit 9cd6ef4b8a5c843ef491437c765d4cb2ff2f8fe3.  See
discussion on review thread.
2024-06-24 08:32:28 -07:00
Yingwei Zheng
9cd6ef4b8a
[RISCV] Remove experimental from Ztso. (#96465)
Ztso 1.0 was ratified in January 2023.
Documentation:
https://github.com/riscv/riscv-isa-manual/blob/main/src/ztso-st-ext.adoc
2024-06-24 20:10:42 +08:00
Monad
2fe72385a4
[RISCV] Add Smcsrind and Sscsrind extension (#93952)
Specification link:
https://github.com/riscv/riscv-isa-manual/blob/main/src/indirect-csr.adoc


Some CSRs (`*ireg` and `*iselect`) in Smcsrind/Sscsrind extensions are
originally defined as part of the Smaia/Ssaia extensions and are already
supported in LLVM. The missing CSRs (`*ireg2` to `*ireg6` for `m`, `s`,
and `vs`) are added in this PR.
2024-06-12 14:33:12 +08:00
Monad
307d91ee62
[RISCV] Add smcdeleg and ssccfg extensions (#95163)
Specification:
https://github.com/riscv/riscv-isa-manual/blob/main/src/smcdeleg.adoc

`Ssccfg` introduces one new CSR `scountinhibit`.
2024-06-12 12:43:39 +08:00
Pengcheng Wang
1bebb99324
[RISCV] Add B extension (#76893)
It seems that we have `B` extension again:
https://github.com/riscv/riscv-b

According to the spec, `B` extension represents the collection of
the `Zba`, `Zbb`, `Zbs` extensions.

Though it hasn't been ratified, I set its version to `1.0`.
2024-06-11 14:06:23 +08:00
AlexGhiti
6b7444964a
[RISCV] Remove experimental from Zabha (#93831)
The Zabha extension was ratified in April 2024.

Co-authored-by: Alexandre Ghiti <alexghiti@rivosinc.com>
2024-06-03 17:27:02 +08:00
Brandon Wu
8be079cddd
[RISCV] Bump Zaamo and Zalrsc to version 1.0 (#91556)
The ratified information can be found here:
https://wiki.riscv.org/display/HOME/Ratified+Extensions
2024-05-21 12:04:46 +08:00
Craig Topper
44645996b0
[RISCV] Add smstateen extension (#90818) 2024-05-02 09:12:44 -07:00
Jesse Huang
b090569685
[RISCV] Support Zama16b1p0 (#88474)
This patch adds the support for Zama16b version 1.0, which has been
added to RVA23U64 optional extensions recently
2024-04-17 14:36:27 +08:00
Craig Topper
74c085fcfc
[RISCV] Add Zcmop and Zimop to RISCVUsage.rst. NFC (#88033)
These extensions are ratified so they were removed from the experimental
section, but not added to the non-experimental section.
2024-04-08 20:35:46 -07:00
Pengcheng Wang
364028a1a5
[RISCV] Zimop/Zcmop are ratified
Remove them from experimental.

See also:
https://github.com/riscv/riscv-isa-manual/blob/main/src/zimop.adoc

Reviewers: kito-cheng

Reviewed By: kito-cheng

Pull Request: https://github.com/llvm/llvm-project/pull/87966
2024-04-08 16:40:02 +08:00
Craig Topper
207e45fb67
[RISCV] Add back SiFive's cdiscard.d.l1, cflush.d.l1, and cease instructions. (#83896)
These were in LLVM 17 but removed from LLVM 18 due to an incorrect
extension name being used.

This restores them with new extension names that match SiFive's
downstream compiler. The extension name has been used internally for
some time. It uses XSiFive instead of XSf like the newer extensions.
`cease` did not have an internal extension name so its using the `XSf`
convention.

The spec for the instructions is here
https://sifive.cdn.prismic.io/sifive/767804da-53b2-4893-97d5-b7c030ae0a94_s76mc_core_complex_manual_21G3.pdf
though the extension name is not listed.

Column width in the extension printing had to be changed to accommodate
a longer extension name.
2024-03-13 14:56:25 -07:00
Brandon Wu
2a1b09fee4
[RISCV][SiFive] Add RISCVUsage for SiFive Intelligence Extensions (#84010) 2024-03-06 09:12:35 +08:00
Wang Pengcheng
3cb999c413
[RISCV] Remove note of Sscofpmf and add a newline after FeatureStdExtSscofpmf (#83958)
To address comments after committing #83831.
2024-03-05 14:26:54 +08:00
Wang Pengcheng
0fbe45bdb9
[RISCV] Add support of Sscofpmf (#83831)
This is used in profile, but somehow we missed it.
2024-03-05 10:45:13 +08:00
Craig Topper
95aab69c10
[RISCV] Remove experimental from Zacas. (#83195)
Document that we don't use the double compare and swap instructions due
to ABI concerns.
2024-02-28 21:46:58 -08:00
Yingwei Zheng
a300a1a711
[RISCV][ISel] Add codegen support for the experimental zabha extension (#80192)
This patch implements the codegen support of zabha (Byte and Halfword
Atomic Memory Operations) v1.0-rc1 extension.
See also https://github.com/riscv/riscv-zabha/blob/v1.0-rc1/zabha.adoc.

---------

Co-authored-by: Craig Topper <craig.topper@sifive.com>
2024-02-16 15:35:09 +08:00
Craig Topper
679d0d7029 [RISCV][Docs] Fix link to Zjpm spec in RISCVUsage.rst. 2024-02-06 22:32:51 -08:00
Craig Topper
f2508d0a40 [RISCV][Docs] Use double underscore for external links in RISCVUsage.rst.
Using a single underscore creates a reference target. If the target
name has the same name as another link, we get a "Duplicate target name"
warning. This is currently happening for Ssqosid.

Using __ prevents this. I've converted all links so no one trips over
this in the future.

One link was missing any underscores so wasn't a link at all in the
generated html.
2024-02-06 10:40:39 -08:00
Craig Topper
2faeea313f
[RISCV] Add Ssqosid support to -march. (#80747) 2024-02-06 10:06:01 -08:00
Michael Maitland
0bf165e383
[RISCV] Add support for RISC-V Pointer Masking (#79929)
This patch implements the v0.8.1 specification. This patch reports
version 0.8 in llvm since `RISCVISAInfo::ExtensionVersion` only has a
`Major` and `Minor` version number. This patch includes includes support
of the `Ssnpm`, `Smnpm`, `Smmpm`, `Sspm` and `Supm` extensions that make
up RISC-V pointer masking.

All of these extensions require emitting attribute containing correct
`march` string.

`Ssnpm`, `Smnpm`, `Smmpm` extensions introduce a 2-bit WARL field (PMM).
The extension does not specify how PMM is set, and therefore this patch
does not need to address this. One example of how it *could* be set is
using the Zicsr instructions to update the PMM bits of the described
registers.

The full specification can be found at
https://github.com/riscv/riscv-j-extension/blob/master/zjpm-spec.pdf
2024-02-05 13:56:25 -05:00
Craig Topper
58c494f47c
[RISCV] Add -march support for many of the S extensions mentioned in the profile specification. (#79399)
This is a good portion of the extensions mentioned in the RVA23 profile
here
https://github.com/riscv/riscv-profiles/blob/main/rva23-profile.adoc

I don't believe these add any new CSRs. Sstc does add new CSRs, but we
already added them without the extension name a while back.

I tried to keep the descriptions in RISCVFeatures.td fairly short since
the strings show up in `-print-supported-extensions`.
2024-02-01 18:50:30 -08:00
Brendan Sweeney
e296cedcd6
[RISCV][MC] MC layer support for the experimental zalasr extension (#79911)
This PR implements experimental support for the RISC-V Atomic
Load-Acquire and Store-Release Extension (Zalasr). It has been approved
to be pursued as a fast track extension
(https://lists.riscv.org/g/tech-unprivileged/topic/arc_architecture_review/101951698),
but has not yet been approved by ARC or ratified. See
https://github.com/mehnadnerd/riscv-zalasr for draft spec.

---------

Co-authored-by: brs <turtwig@utexas.edu>
Co-authored-by: Philip Reames <preames@rivosinc.com>
2024-02-01 10:58:21 -08:00
Yingwei Zheng
89f87c3876
[RISCV][MC] Add MC layer support for the experimental zabha extension (#80005)
This patch implements the zabha (Byte and Halfword Atomic Memory
Operations) v1.0-rc1 extension.
See also https://github.com/riscv/riscv-zabha/blob/v1.0-rc1/zabha.adoc.
2024-01-31 17:06:43 +08:00
Alex Bradbury
d833b9d677
[RISCV] Graduate Zicond to non-experimental (#79811)
The Zicond extension was ratified in the last few months, with no
changes that affect the LLVM implementation. Although there's surely
more tuning that could be done about when to select Zicond or not, there
are no known correctness issues. Therefore, we should mark support as
non-experimental.
2024-01-29 15:58:54 +00:00
Wang Pengcheng
1a14c446dd
[RISCV][MC] Add experimental support of Zaamo and Zalrsc
`A` extension has been split into two parts: Zaamo (Atomic Memory
Operations) and Zalrsc (Load-Reserved/Store-Conditional). See also
https://github.com/riscv/riscv-zaamo-zalrsc.

This patch adds the MC support.

Reviewers: dtcxzyw, topperc, kito-cheng

Reviewed By: topperc

Pull Request: https://github.com/llvm/llvm-project/pull/78970
2024-01-25 17:03:25 +08:00
Craig Topper
29c9009d23 [Docs] Capitalize the first letter of Zi* extensions in RISCVUsage.rst. NFC 2024-01-24 21:40:37 -08:00