<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Apr 30, 2017 8:14 AM, "Karol Herbst" <<a href="mailto:karolherbst@gmail.com">karolherbst@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">2017-04-30 2:28 GMT+02:00 Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>>:<br>
> Maybe in a separate change. I'd want to double check on all gens. I think<br>
> the thing I suggested is sufficient.<br>
><br>
<br>
</div>well, if I just fixup the op, I kind of have to fix the mod as well.<br>
And if I use getOp, it could also return a OP_CVT, so I have to do the<br>
check.<br>
<br>
I don't see how I can only use getOp, but not fixing the mod?<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Perhaps this all doesn't work the way I remember. Will try to look during the week.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="elided-text"><br>
> On Apr 29, 2017 8:09 PM, "Karol Herbst" <<a href="mailto:karolherbst@gmail.com">karolherbst@gmail.com</a>> wrote:<br>
><br>
> 2017-04-30 0:28 GMT+02:00 Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>>:<br>
>> On Sat, Apr 29, 2017 at 6:09 PM, Karol Herbst <<a href="mailto:karolherbst@gmail.com">karolherbst@gmail.com</a>><br>
>> wrote:<br>
>>> helps two alien isolation shaders<br>
>>><br>
>>> shader-db:<br>
>>> total instructions in shared programs : 4251497 -> 4251494 (-0.00%)<br>
>>> total gprs used in shared programs : 513962 -> 513962 (0.00%)<br>
>>> total local used in shared programs : 29797 -> 29797 (0.00%)<br>
>>> total bytes used in shared programs : 38960264 -> 38960232 (-0.00%)<br>
>>><br>
>>> local gpr inst bytes<br>
>>> helped 0 0 2 2<br>
>>> hurt 0 0 0 0<br>
>>><br>
>>> v2: handle potential mods on src0<br>
>>><br>
>>> Signed-off-by: Karol Herbst <<a href="mailto:karolherbst@gmail.com">karolherbst@gmail.com</a>><br>
>>> Reviewed-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>><br>
>>> Reviewed-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>><br>
>>> ---<br>
>>> src/gallium/drivers/nouveau/<wbr>codegen/nv50_ir_peephole.cpp | 7 +++++++<br>
>>> 1 file changed, 7 insertions(+)<br>
>>><br>
>>> diff --git a/src/gallium/drivers/nouveau/<wbr>codegen/nv50_ir_peephole.cpp<br>
>>> b/src/gallium/drivers/nouveau/<wbr>codegen/nv50_ir_peephole.cpp<br>
>>> index 015def0391..82da0d3e48 100644<br>
>>> --- a/src/gallium/drivers/nouveau/<wbr>codegen/nv50_ir_peephole.cpp<br>
>>> +++ b/src/gallium/drivers/nouveau/<wbr>codegen/nv50_ir_peephole.cpp<br>
>>> @@ -1284,6 +1284,13 @@ ConstantFolding::opnd(<wbr>Instruction *i,<br>
>>> ImmediateValue &imm0, int s)<br>
>>><br>
>>> case OP_SHL:<br>
>>> {<br>
>>> + if (s == 1 && imm0.isInteger(0)) {<br>
>>> + i->op = i->src(0).mod.getOp();<br>
>>> + if (i->op != OP_CVT)<br>
>>> + i->src(0).mod = 0;<br>
>><br>
>> Is this necessary? Presumably if the op != 0, then op == OP_CVT...<br>
>><br>
><br>
> yeah, no idea. I just thought I do it right when I actually depend on<br>
> the getOp magic. But we can't emit any mods to begin with, so maybe we<br>
> should just drop the mod handling and be done with it?<br>
><br>
>>> + i->setSrc(1, NULL);<br>
>>> + break;<br>
>>> + }<br>
>>> if (s != 1 || i->src(0).mod != Modifier(0))<br>
>>> break;<br>
>>> // try to concatenate shifts<br>
>>> --<br>
>>> 2.12.2<br>
>>><br>
><br>
><br>
</div></blockquote></div><br></div></div></div>