-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[SelectionDAG] Add f16
soft promotion for lrint
and lround
#152684
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
|
||
#include "LegalizeTypes.h" | ||
#include "llvm/Analysis/TargetLibraryInfo.h" | ||
#include "llvm/CodeGen/ISDOpcodes.h" | ||
#include "llvm/Support/ErrorHandling.h" | ||
#include "llvm/Support/raw_ostream.h" | ||
using namespace llvm; | ||
|
@@ -3729,10 +3730,20 @@ bool DAGTypeLegalizer::SoftPromoteHalfOperand(SDNode *N, unsigned OpNo) { | |
Res = SoftPromoteHalfOp_FAKE_USE(N, OpNo); | ||
break; | ||
case ISD::FCOPYSIGN: Res = SoftPromoteHalfOp_FCOPYSIGN(N, OpNo); break; | ||
case ISD::FP_TO_SINT: | ||
case ISD::FP_TO_UINT: | ||
case ISD::LLRINT: | ||
case ISD::LLROUND: | ||
case ISD::LRINT: | ||
case ISD::LROUND: | ||
case ISD::STRICT_FP_TO_SINT: | ||
case ISD::STRICT_FP_TO_UINT: | ||
case ISD::FP_TO_SINT: | ||
case ISD::FP_TO_UINT: Res = SoftPromoteHalfOp_FP_TO_XINT(N); break; | ||
case ISD::STRICT_LLRINT: | ||
case ISD::STRICT_LLROUND: | ||
case ISD::STRICT_LRINT: | ||
case ISD::STRICT_LROUND: | ||
Comment on lines
+3741
to
+3744
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. strict cases also not tested? |
||
Res = SoftPromoteHalfOp_UnaryOp(N); | ||
break; | ||
case ISD::FP_TO_SINT_SAT: | ||
case ISD::FP_TO_UINT_SAT: | ||
Res = SoftPromoteHalfOp_FP_TO_XINT_SAT(N); break; | ||
|
@@ -3811,7 +3822,7 @@ SDValue DAGTypeLegalizer::SoftPromoteHalfOp_FP_EXTEND(SDNode *N) { | |
return DAG.getNode(GetPromotionOpcode(SVT, RVT), SDLoc(N), RVT, Op); | ||
} | ||
|
||
SDValue DAGTypeLegalizer::SoftPromoteHalfOp_FP_TO_XINT(SDNode *N) { | ||
SDValue DAGTypeLegalizer::SoftPromoteHalfOp_UnaryOp(SDNode *N) { | ||
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. I think this provides the correct operation for 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. I wouldn't name this UnaryOp - that implies it's an FP-to-FP same type operation which this is not |
||
EVT RVT = N->getValueType(0); | ||
bool IsStrict = N->isStrictFPOpcode(); | ||
SDValue Op = N->getOperand(IsStrict ? 1 : 0); | ||
|
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.
Test changes seem to only cover lrint and llrint, and not lround/llround