<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 11, 2018 at 12:20 AM, Iago Toral Quiroga <span dir="ltr"><<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Jose Maria Casanova Crespo <<a href="mailto:jmcasanova@igalia.com">jmcasanova@igalia.com</a>><br>
<br>
16-bit immediates are replicated in each word of a 32-bit value<br>
so we need to negate both.<br>
---<br>
 src/intel/compiler/brw_shader.<wbr>cpp | 5 ++---<br>
 1 file changed, 2 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/intel/compiler/brw_<wbr>shader.cpp b/src/intel/compiler/brw_<wbr>shader.cpp<br>
index 9cdf9fcb23d..c7edc60b63d 100644<br>
--- a/src/intel/compiler/brw_<wbr>shader.cpp<br>
+++ b/src/intel/compiler/brw_<wbr>shader.cpp<br>
@@ -581,7 +581,8 @@ brw_negate_immediate(enum brw_reg_type type, struct brw_reg *reg)<br>
       return true;<br>
    case BRW_REGISTER_TYPE_W:<br>
    case BRW_REGISTER_TYPE_UW:<br>
-      reg->d = -(int16_t)reg->ud;<br>
+   case BRW_REGISTER_TYPE_HF:<br>
+      reg->ud ^= 0x80008000;<br></blockquote><div><br></div><div>This is not correct for integers.  We need to keep two separate cases.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
       return true;<br>
    case BRW_REGISTER_TYPE_F:<br>
       reg->f = -reg->f;<br>
@@ -602,8 +603,6 @@ brw_negate_immediate(enum brw_reg_type type, struct brw_reg *reg)<br>
    case BRW_REGISTER_TYPE_UV:<br>
    case BRW_REGISTER_TYPE_V:<br>
       assert(!"unimplemented: negate UV/V immediate");<br>
-   case BRW_REGISTER_TYPE_HF:<br>
-      assert(!"unimplemented: negate HF immediate");<br>
    case BRW_REGISTER_TYPE_NF:<br>
       unreachable("no NF immediates");<br>
    }<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.14.1<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">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/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>