-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[SPARC] Use op-then-halve instructions when we have VIS3 #135718
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
Changes from 2 commits
904fd88
9696d19
e0f99c4
d942a7f
31c6f5a
561990c
71ffd3d
7586c5f
4a968b2
840c95d
50422a4
142bf8f
d01cb06
610572e
095fcf0
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 | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3605,15 +3605,23 @@ bool SparcTargetLowering::useLoadStackGuardNode(const Module &M) const { | |||||||||||||||
return true; | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
bool SparcTargetLowering::isFNegFree(EVT VT) const { | ||||||||||||||||
if (Subtarget->isVIS3()) | ||||||||||||||||
return VT == MVT::f32 || VT == MVT::f64; | ||||||||||||||||
return false; | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
bool SparcTargetLowering::isFPImmLegal(const APFloat &Imm, EVT VT, | ||||||||||||||||
bool ForCodeSize) const { | ||||||||||||||||
bool CanLower = false; | ||||||||||||||||
if (VT != MVT::f32 && VT != MVT::f64) | ||||||||||||||||
return false; | ||||||||||||||||
if (Imm.isZero()) | ||||||||||||||||
return Subtarget->isVIS(); | ||||||||||||||||
if (Imm.isExactlyValue(+0.5) || Imm.isExactlyValue(-0.5)) | ||||||||||||||||
return Subtarget->isVIS3(); | ||||||||||||||||
return false; | ||||||||||||||||
if (Subtarget->isVIS()) | ||||||||||||||||
CanLower = CanLower || Imm.isZero(); | ||||||||||||||||
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
Did this mean to include -0? 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. Yes, +0 and -0. |
||||||||||||||||
if (Subtarget->isVIS3()) | ||||||||||||||||
CanLower = | ||||||||||||||||
CanLower || (Imm.isExactlyValue(+0.5) || Imm.isExactlyValue(-0.5)); | ||||||||||||||||
return CanLower; | ||||||||||||||||
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
Could also use getExactLog2Abs == -1? |
||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
bool SparcTargetLowering::isCtlzFast() const { return Subtarget->isVIS3(); } | ||||||||||||||||
|
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.