-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[LLVM] Slay undead copysign code #111269
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?
[LLVM] Slay undead copysign code #111269
Changes from all commits
7745181
5aaacd7
e277a8e
5fd0d86
bd017cc
2ddf2ef
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1709,12 +1709,19 @@ void DAGTypeLegalizer::ExpandFloatRes_FCEIL(SDNode *N, | |||||||||
|
||||||||||
void DAGTypeLegalizer::ExpandFloatRes_FCOPYSIGN(SDNode *N, | ||||||||||
SDValue &Lo, SDValue &Hi) { | ||||||||||
ExpandFloatRes_Binary(N, GetFPLibCall(N->getValueType(0), | ||||||||||
RTLIB::COPYSIGN_F32, | ||||||||||
RTLIB::COPYSIGN_F64, | ||||||||||
RTLIB::COPYSIGN_F80, | ||||||||||
RTLIB::COPYSIGN_F128, | ||||||||||
RTLIB::COPYSIGN_PPCF128), Lo, Hi); | ||||||||||
|
||||||||||
assert(N->getValueType(0) == MVT::ppcf128 && | ||||||||||
"Logic only correct for ppcf128!"); | ||||||||||
SDLoc DL = SDLoc(N); | ||||||||||
SDValue Tmp = SDValue(); | ||||||||||
Comment on lines
+1715
to
+1716
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.
Suggested change
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. The LLVM style guide specifically said I should "Use auto Type Deduction to Make Code More Readable". So I did. Then I was advised to not. So I accepted that. But I find these changes make the code significantly harder to read. Are you aware of another programming language that implements this... most vexing constructor form? |
||||||||||
GetExpandedFloat(N->getOperand(0), Lo, Tmp); | ||||||||||
|
||||||||||
Hi = DAG.getNode(ISD::FCOPYSIGN, DL, Tmp.getValueType(), Tmp, | ||||||||||
N->getOperand(1)); | ||||||||||
// A double-double is Hi + Lo, so if Hi flips sign, so must Lo | ||||||||||
Lo = DAG.getSelectCC(DL, Tmp, Hi, Lo, | ||||||||||
DAG.getNode(ISD::FNEG, DL, Lo.getValueType(), Lo), | ||||||||||
ISD::SETUEQ); | ||||||||||
} | ||||||||||
|
||||||||||
void DAGTypeLegalizer::ExpandFloatRes_FCOS(SDNode *N, | ||||||||||
|
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.