-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[RISCV] Add subtarget features for profiles #84877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wangpc-pp
merged 11 commits into
main
from
users/wangpc-pp/spr/riscv-add-generic-cpus-for-profiles
Apr 28, 2024
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ec68548
[𝘀𝗽𝗿] initial version
wangpc-pp dc37018
Remove genenic prefix
wangpc-pp 452cbe8
Rebase
wangpc-pp 3ffb796
Expose features instead of CPUs
wangpc-pp e03f2cd
We should add FeatureStdExtI explicitly now
wangpc-pp c5f08b6
[𝘀𝗽𝗿] changes introduced through rebase
wangpc-pp 0fdb150
Rebase
wangpc-pp cf6a023
Remove getRISCVProfile()
wangpc-pp f51cf9a
Remove RISCVProfileEnum
wangpc-pp cf5591b
Move RISCVProfiles.td next to RISCVFeatures.td
wangpc-pp 4d2f33b
[𝘀𝗽𝗿] landed version
wangpc-pp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
//===------ RISCVProfiles.td - RISC-V Profiles -------------*- tablegen -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
class RISCVProfile<string name, list<SubtargetFeature> features> | ||
: SubtargetFeature<name, "RISCVProfile", NAME, | ||
wangpc-pp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"RISC-V " # name # " profile", features>; | ||
|
||
defvar RVI20U32Features = [Feature32Bit, FeatureStdExtI]; | ||
defvar RVI20U64Features = [Feature64Bit, FeatureStdExtI]; | ||
|
||
defvar RVA20U64Features = [Feature64Bit, | ||
FeatureStdExtI, | ||
FeatureStdExtM, | ||
FeatureStdExtA, | ||
FeatureStdExtF, | ||
FeatureStdExtD, | ||
FeatureStdExtC, | ||
FeatureStdExtZicntr, | ||
FeatureStdExtZiccif, | ||
FeatureStdExtZiccrse, | ||
FeatureStdExtZiccamoa, | ||
FeatureStdExtZa128rs, | ||
FeatureStdExtZicclsm]; | ||
|
||
defvar RVA20S64Features = !listconcat(RVA20U64Features, | ||
[FeatureStdExtZifencei, | ||
FeatureStdExtSvbare, | ||
FeatureStdExtSvade, | ||
FeatureStdExtSsccptr, | ||
FeatureStdExtSstvecd, | ||
FeatureStdExtSstvala]); | ||
|
||
defvar RVA22U64Features = [Feature64Bit, | ||
FeatureStdExtI, | ||
FeatureStdExtM, | ||
FeatureStdExtA, | ||
FeatureStdExtF, | ||
FeatureStdExtD, | ||
FeatureStdExtC, | ||
FeatureStdExtZicntr, | ||
FeatureStdExtZiccif, | ||
FeatureStdExtZiccrse, | ||
FeatureStdExtZiccamoa, | ||
FeatureStdExtZicclsm, | ||
FeatureStdExtZa64rs, | ||
FeatureStdExtZihpm, | ||
FeatureStdExtZihintpause, | ||
FeatureStdExtZba, | ||
FeatureStdExtZbb, | ||
FeatureStdExtZbs, | ||
FeatureStdExtZic64b, | ||
FeatureStdExtZicbom, | ||
FeatureStdExtZicbop, | ||
FeatureStdExtZicboz, | ||
FeatureStdExtZfhmin, | ||
FeatureStdExtZkt]; | ||
|
||
defvar RVA22S64Features = !listconcat(RVA22U64Features, | ||
[FeatureStdExtZifencei, | ||
FeatureStdExtSvbare, | ||
FeatureStdExtSvade, | ||
FeatureStdExtSsccptr, | ||
FeatureStdExtSstvecd, | ||
FeatureStdExtSstvala, | ||
FeatureStdExtSscounterenw, | ||
FeatureStdExtSvpbmt, | ||
FeatureStdExtSvinval]); | ||
|
||
defvar RVA23U64Features = [Feature64Bit, | ||
FeatureStdExtI, | ||
FeatureStdExtM, | ||
FeatureStdExtA, | ||
FeatureStdExtF, | ||
FeatureStdExtD, | ||
FeatureStdExtC, | ||
FeatureStdExtZicntr, | ||
FeatureStdExtZihpm, | ||
FeatureStdExtZiccif, | ||
FeatureStdExtZiccrse, | ||
FeatureStdExtZiccamoa, | ||
FeatureStdExtZicclsm, | ||
FeatureStdExtZa64rs, | ||
FeatureStdExtZihintpause, | ||
FeatureStdExtZba, | ||
FeatureStdExtZbb, | ||
FeatureStdExtZbs, | ||
FeatureStdExtZic64b, | ||
FeatureStdExtZicbom, | ||
FeatureStdExtZicbop, | ||
FeatureStdExtZicboz, | ||
FeatureStdExtZfhmin, | ||
FeatureStdExtZkt, | ||
FeatureStdExtV, | ||
FeatureStdExtZvfhmin, | ||
FeatureStdExtZvbb, | ||
FeatureStdExtZvkt, | ||
FeatureStdExtZihintntl, | ||
FeatureStdExtZicond, | ||
FeatureStdExtZimop, | ||
FeatureStdExtZcmop, | ||
FeatureStdExtZcb, | ||
FeatureStdExtZfa, | ||
FeatureStdExtZawrs]; | ||
|
||
defvar RVA23S64Features = !listconcat(RVA23U64Features, | ||
[FeatureStdExtZifencei, | ||
FeatureStdExtSvbare, | ||
FeatureStdExtSvade, | ||
FeatureStdExtSsccptr, | ||
FeatureStdExtSstvecd, | ||
FeatureStdExtSstvala, | ||
FeatureStdExtSscounterenw, | ||
FeatureStdExtSvpbmt, | ||
FeatureStdExtSvinval, | ||
FeatureStdExtSvnapot, | ||
FeatureStdExtSstc, | ||
FeatureStdExtSscofpmf, | ||
FeatureStdExtSsnpm, | ||
FeatureStdExtSsu64xl, | ||
FeatureStdExtH, | ||
FeatureStdExtSsstateen, | ||
FeatureStdExtShcounterenw, | ||
FeatureStdExtShvstvala, | ||
FeatureStdExtShtvala, | ||
FeatureStdExtShvstvecd, | ||
FeatureStdExtShvsatpa, | ||
FeatureStdExtShgatpa]); | ||
|
||
defvar RVB23U64Features = [Feature64Bit, | ||
FeatureStdExtI, | ||
FeatureStdExtM, | ||
FeatureStdExtA, | ||
FeatureStdExtF, | ||
FeatureStdExtD, | ||
FeatureStdExtC, | ||
FeatureStdExtZicntr, | ||
FeatureStdExtZihpm, | ||
FeatureStdExtZiccif, | ||
FeatureStdExtZiccrse, | ||
FeatureStdExtZiccamoa, | ||
FeatureStdExtZicclsm, | ||
FeatureStdExtZa64rs, | ||
FeatureStdExtZihintpause, | ||
FeatureStdExtZba, | ||
FeatureStdExtZbb, | ||
FeatureStdExtZbs, | ||
FeatureStdExtZic64b, | ||
FeatureStdExtZicbom, | ||
FeatureStdExtZicbop, | ||
FeatureStdExtZicboz, | ||
FeatureStdExtZkt, | ||
FeatureStdExtZihintntl, | ||
FeatureStdExtZicond, | ||
FeatureStdExtZimop, | ||
FeatureStdExtZcmop, | ||
FeatureStdExtZcb, | ||
FeatureStdExtZfa, | ||
FeatureStdExtZawrs]; | ||
|
||
defvar RVB23S64Features = !listconcat(RVB23U64Features, | ||
[FeatureStdExtZifencei, | ||
FeatureStdExtSvnapot, | ||
FeatureStdExtSvbare, | ||
FeatureStdExtSvade, | ||
FeatureStdExtSsccptr, | ||
FeatureStdExtSstvecd, | ||
FeatureStdExtSstvala, | ||
FeatureStdExtSscounterenw, | ||
FeatureStdExtSvpbmt, | ||
FeatureStdExtSvinval, | ||
FeatureStdExtSstc, | ||
FeatureStdExtSscofpmf, | ||
FeatureStdExtSsu64xl]); | ||
|
||
defvar RVM23U32Features = [Feature32Bit, | ||
FeatureStdExtI, | ||
FeatureStdExtM, | ||
FeatureStdExtZba, | ||
FeatureStdExtZbb, | ||
FeatureStdExtZbs, | ||
FeatureStdExtZicond, | ||
FeatureStdExtZihintpause, | ||
FeatureStdExtZihintntl, | ||
FeatureStdExtZce, | ||
FeatureStdExtZicbop, | ||
FeatureStdExtZimop, | ||
FeatureStdExtZcmop]; | ||
|
||
def RVI20U32 : RISCVProfile<"rvi20u32", RVI20U32Features>; | ||
def RVI20U64 : RISCVProfile<"rvi20u64", RVI20U64Features>; | ||
def RVA20U64 : RISCVProfile<"rva20u64", RVA20U64Features>; | ||
def RVA20S64 : RISCVProfile<"rva20s64", RVA20S64Features>; | ||
def RVA22U64 : RISCVProfile<"rva22u64", RVA22U64Features>; | ||
def RVA22S64 : RISCVProfile<"rva22s64", RVA22S64Features>; | ||
def RVA23U64 : RISCVProfile<"rva23u64", RVA23U64Features>; | ||
def RVA23S64 : RISCVProfile<"rva23s64", RVA23S64Features>; | ||
def RVB23U64 : RISCVProfile<"rvb23u64", RVB23U64Features>; | ||
def RVB23S64 : RISCVProfile<"rvb23s64", RVB23S64Features>; | ||
def RVM23U32 : RISCVProfile<"rvm23u32", RVM23U32Features>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.