Add Word rotates to the list of instructions that are zero extending.
This allows them to be used in dot form to compare with zero.
Details
Diff Detail
Event Timeline
I don't think this is right. RLWINM starts by taking two copies of the 32-bit amount, one copy in the lower word and one copy in the upper word and rotates the result, Then it composes the mask. The mask is non-zero in the upper bits if MB >= ME.
You're right. We came up with the usual case, but not the normal case. Kyle
is going to add a check for the arguments as well :)
-eric
Added an operand check to make sure that we only perform this optimization in the case where the mask causes the upper 32 bits to be zeroed out.
Also add a test case to verify that it fires in the correct case, and doesn't fire in the incorrect case.
One nit from me, but given I missed one thing previously I'm going to ask Hal to ack this one :)
-eric
lib/Target/PowerPC/PPCInstrInfo.cpp | ||
---|---|---|
1557–1561 | Stylistic request: Can you move this closer to the use please? |
lib/Target/PowerPC/PPCInstrInfo.cpp | ||
---|---|---|
1559 | I think you mean to use MIOpC == PPC::RLWINMo as the second part of the or statement |
lib/Target/PowerPC/PPCInstrInfo.cpp | ||
---|---|---|
1559 | I actually meant to use PPC::RLWNM. |
lib/Target/PowerPC/PPCInstrInfo.cpp | ||
---|---|---|
1559 | OK, this might be a dumb question then but why not include the dot version of the instructions (RLWINMo and RLWNMo) as well? |
lib/Target/PowerPC/PPCInstrInfo.cpp | ||
---|---|---|
1559 | I've added them, but maybe someone else can chime in. Is the goal of checking for those forms to allow for the collapse of multiple compares? Is this something that shows up in real code, or a belt/suspenders check? |
lib/Target/PowerPC/PPCInstrInfo.cpp | ||
---|---|---|
1557–1561 | Sorry, I closed this without actually moving it closer. Really done now. |
I think you mean to use MIOpC == PPC::RLWINMo as the second part of the or statement