-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[RISCV][llvm] Preliminary P extension codegen support #162668
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
Merged
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ef7900d
[RISCV][llvm] Preliminary P extension codegen support
4vtomat bc91902
fixup! fix pasub, add BUILD_VECTOR, fix comments
4vtomat 34dc464
fixup! add a switch for codegen
4vtomat 47c5eb4
fixup! handle rv32 legalization
4vtomat 7d6a831
fixup! use vector_concats
4vtomat 228d38f
fixup! hardware mode
4vtomat e308c09
fixup! resolve comments
4vtomat b316dc3
Merge remote-tracking branch 'origin/main' into p_ext_codegen
4vtomat e10520a
fixup! teach RISCVMat about PLI
4vtomat aa7bb56
fixup! resolve comment
4vtomat cb235c8
Merge remote-tracking branch 'origin/main' into p_ext_codegen
4vtomat 9694d2c
fixup! accidentally deleted line
4vtomat 282aa19
Merge remote-tracking branch 'origin/main' into p_ext_codegen
4vtomat 3502c4d
fixup! remove unused isd
4vtomat bba3c88
fixup! use timm, remove unused switch case
4vtomat 63194c2
fixup! cleanup, typo, subtarget
4vtomat f8f1d98
fixup! resolve comments
4vtomat 53f602b
fixup! wording
4vtomat 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
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -991,6 +991,18 @@ static unsigned getSegInstNF(unsigned Intrinsic) { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| static bool isApplicableToPLI(int Val) { | ||||||
| // Check if the immediate is packed i8 or i10 | ||||||
| int16_t Bit31To16 = Val >> 16; | ||||||
| int16_t Bit15To0 = Val; | ||||||
| int8_t Bit15To8 = Bit15To0 >> 8; | ||||||
| int8_t Bit7To0 = Val; | ||||||
| if (Bit31To16 != Bit15To0) | ||||||
| return false; | ||||||
|
|
||||||
| return isInt<10>(Bit31To16) || Bit15To8 == Bit7To0; | ||||||
| } | ||||||
|
|
||||||
| void RISCVDAGToDAGISel::Select(SDNode *Node) { | ||||||
| // If we have a custom node, we have already selected. | ||||||
| if (Node->isMachineOpcode()) { | ||||||
|
|
@@ -1034,6 +1046,14 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) { | |||||
| if (!isInt<32>(Imm) && isUInt<32>(Imm) && hasAllWUsers(Node)) | ||||||
| Imm = SignExtend64<32>(Imm); | ||||||
|
|
||||||
| if (Subtarget->enablePExtCodeGen() && isApplicableToPLI(Imm) && | ||||||
| hasAllWUsers(Node)) { | ||||||
| // If its 4 packed 8-bit integers or 2 packed signed 16-bit integers, we | ||||||
|
||||||
| // If its 4 packed 8-bit integers or 2 packed signed 16-bit integers, we | |
| // If it's 4 packed 8-bit integers or 2 packed signed 16-bit integers, we |
Oops, something went wrong.
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.