-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[RISC-V] Add support for MIPS P8700 CPU #117865
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a3ed355
[RISCV] Add MIPS p8700 scheduler and target cpu
djtodoro 9b0b29c
[RISCV] Add MIPS extensions
djtodoro 4aa168a
[clang][RISCV] Set default CPU for `mti` vendor
djtodoro c503eca
[clang] Add driver support for riscv64-mti toolchains
djtodoro d35403f
[RISCV] Enable SeparateConstOffsetFromGEPPass for RISC-V
djtodoro 4f39531
[RISCV] Add RemoveBackToBackBranches Pass
djtodoro 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2464,6 +2464,9 @@ bool RISCVInstrInfo::verifyInstruction(const MachineInstr &MI, | |
| case RISCVOp::OPERAND_UIMM7_LSB00: | ||
| Ok = isShiftedUInt<5, 2>(Imm); | ||
| break; | ||
| case RISCVOp::OPERAND_UIMM7_LSB000: | ||
| Ok = isShiftedUInt<4, 3>(Imm); | ||
| break; | ||
| case RISCVOp::OPERAND_UIMM8_LSB00: | ||
| Ok = isShiftedUInt<6, 2>(Imm); | ||
| break; | ||
|
|
@@ -2710,6 +2713,45 @@ MachineInstr *RISCVInstrInfo::emitLdStWithAddr(MachineInstr &MemI, | |
| .setMemRefs(MemI.memoperands()) | ||
| .setMIFlags(MemI.getFlags()); | ||
| } | ||
| bool RISCVInstrInfo::isPairableLdStInstOpc(unsigned Opc) { | ||
| switch (Opc) { | ||
| default: | ||
| return false; | ||
| case RISCV::SH: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This list doesn't match what's supported in
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is true. I have added a TODO marker for it in #121394. |
||
| case RISCV::LH: | ||
| case RISCV::LHU: | ||
| case RISCV::SW: | ||
| case RISCV::FSW: | ||
| case RISCV::LW: | ||
| case RISCV::FLW: | ||
| case RISCV::SD: | ||
| case RISCV::FSD: | ||
| case RISCV::LD: | ||
| case RISCV::FLD: | ||
| return true; | ||
| } | ||
| } | ||
|
|
||
| bool RISCVInstrInfo::isLdStSafeToPair(const MachineInstr &LdSt, | ||
| const TargetRegisterInfo *TRI) { | ||
| // If this is a volatile load/store, don't mess with it. | ||
| if (LdSt.hasOrderedMemoryRef() || LdSt.getNumExplicitOperands() != 3) | ||
| return false; | ||
|
|
||
| if (LdSt.getOperand(1).isFI()) | ||
| return true; | ||
|
|
||
| assert(LdSt.getOperand(1).isReg() && "Expected a reg operand."); | ||
| // Can't cluster if the instruction modifies the base register | ||
| // or it is update form. e.g. ld x5,8(x5) | ||
| if (LdSt.modifiesRegister(LdSt.getOperand(1).getReg(), TRI)) | ||
| return false; | ||
|
|
||
| if (!LdSt.getOperand(2).isImm()) | ||
| return false; | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| bool RISCVInstrInfo::getMemOperandsWithOffsetWidth( | ||
| const MachineInstr &LdSt, SmallVectorImpl<const MachineOperand *> &BaseOps, | ||
|
|
||
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
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.