-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[RISCV][VP] Introduce vp saturating addition/subtraction and RISC-V support. #82370
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
Conversation
…support. This patch also pick the MatchContext framework from DAGCombiner to an indiviual header file to make the framework be used from other files in llvm/lib/CodeGen/SelectionDAG/.
@llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-backend-risc-v Author: Yeting Kuo (yetingk) ChangesThis patch also pick the MatchContext framework from DAGCombiner to an indiviual header file to make the framework be used from other files in llvm/lib/CodeGen/SelectionDAG/. Patch is 455.08 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/82370.diff 15 Files Affected:
|
You can test this locally with the following command:
View the diff from clang-format here.
|
unsigned OldBits = Op1.getScalarValueSizeInBits(); | ||
|
||
unsigned Opcode = N->getOpcode(); | ||
unsigned Opcode = matcher.getRootBaseOpcode(); | ||
bool IsShift = Opcode == ISD::USHLSAT || Opcode == ISD::SSHLSAT; | ||
|
||
SDValue Op1Promoted, Op2Promoted; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we have VP aware versions of ZExtPromotedInteger and SExtPromotedInteger?
I guess that would require a VP_SIGN_EXTEND_INREG so maybe for a future patch. Or we'd have to emit a pair of VP_SHL and VP_SRA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a FIXME for this instead to fix it in this PR. Is it Ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
llvm/docs/LangRef.rst
Outdated
Arguments: | ||
"""""""""" | ||
|
||
The first two operand and the result have the same vector of integer type. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"two operand" -> "two operands". Is this a typo in existing descriptions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. It's just my typo.
llvm/docs/LangRef.rst
Outdated
Semantics: | ||
"""""""""" | ||
|
||
The '``llvm.vp.sadd.sat``' intrinsic performs sadd.sat (:ref:`sadd.sat <int_sadd_sat>`) of the first, second, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"first, second, vector operand -> "first and second vector operands"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This patch also pick the MatchContext framework from DAGCombiner to an indiviual header file to make the framework be used from other files in llvm/lib/CodeGen/SelectionDAG/.