<p dir="ltr">Oh wait, we don't fold it in because it's a SUB, duh. So that bit makes sense. I'd slightly prefer flipping the neg modifier, but your call.</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Jul 4, 2016 8:17 AM, "Samuel Pitoiset" <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 07/04/2016 01:59 PM, Ilia Mirkin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That flips the sign of the immediate. Why not flip 0x35, which is an<br>
explicit neg modifier? I guess we mess with the immediate in the other<br>
emitters, so r-b either way.<br>
</blockquote>
<br>
Sure, that flips the sign yeah.<br>
<br>
I guess we mess up with the neg modifier actually because it is not set for that source. I didn't check the other emitters but that test passes on GK107 (and probably on GF100/GK110 as well).<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
As an aside, how did you hit this? Should have gotten folded in...<br>
</blockquote>
<br>
With piglit. :)<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Jul 4, 2016 7:12 AM, "Samuel Pitoiset" <<a href="mailto:samuel.pitoiset@gmail.com" target="_blank">samuel.pitoiset@gmail.com</a><br>
<mailto:<a href="mailto:samuel.pitoiset@gmail.com" target="_blank">samuel.pitoiset@gmail.com</a>>> wrote:<br>
<br>
When emitting OP_SUB, the sign bit for FADD and FADD32I is not<br>
at the same position. It's at position 45 for FADD but 51 for FADD32I.<br>
<br>
This fixes the following piglit test:<br>
tests/spec/arb_fragment_program/fdo30337b.shader_test<br>
<br>
Signed-off-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com" target="_blank">samuel.pitoiset@gmail.com</a><br>
<mailto:<a href="mailto:samuel.pitoiset@gmail.com" target="_blank">samuel.pitoiset@gmail.com</a>>><br>
Cc: <<a href="mailto:mesa-stable@lists.freedesktop.org" target="_blank">mesa-stable@lists.freedesktop.org</a><br>
<mailto:<a href="mailto:mesa-stable@lists.freedesktop.org" target="_blank">mesa-stable@lists.freedesktop.org</a>>><br>
---<br>
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp | 9<br>
++++++---<br>
1 file changed, 6 insertions(+), 3 deletions(-)<br>
<br>
diff --git<br>
a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp<br>
b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp<br>
index 2c5e8f6..f1ba27a 100644<br>
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp<br>
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp<br>
@@ -1234,6 +1234,9 @@ CodeEmitterGM107::emitFADD()<br>
emitABS(0x2e, insn->src(0));<br>
emitNEG(0x2d, insn->src(1));<br>
emitFMZ(0x2c, 1);<br>
+<br>
+ if (insn->op == OP_SUB)<br>
+ code[1] ^= 0x00002000;<br>
} else {<br>
emitInsn(0x08000000);<br>
emitABS(0x39, insn->src(1));<br>
@@ -1243,10 +1246,10 @@ CodeEmitterGM107::emitFADD()<br>
emitNEG(0x35, insn->src(1));<br>
emitCC (0x34);<br>
emitIMMD(0x14, 32, insn->src(1));<br>
- }<br>
<br>
- if (insn->op == OP_SUB)<br>
- code[1] ^= 0x00002000;<br>
+ if (insn->op == OP_SUB)<br>
+ code[1] ^= 0x00080000;<br>
+ }<br>
<br>
emitGPR(0x08, insn->src(0));<br>
emitGPR(0x00, insn->def(0));<br>
--<br>
2.8.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a> <mailto:<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a>><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
<br>
</blockquote>
<br>
-- <br>
-Samuel<br>
</blockquote></div></div>