<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 27, 2016 at 11:24 AM, Jordan Justen <span dir="ltr"><<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">v2:<br>
 * simd16/32 fixes (curro)<br>
<br>
Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
---<br>
 src/compiler/nir/nir_intrinsics.h        |  1 +<br>
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 15 +++++++++++++++<br>
 2 files changed, 16 insertions(+)<br>
<br>
diff --git a/src/compiler/nir/nir_intrinsics.h b/src/compiler/nir/nir_intrinsics.h<br>
index aeb6038..6f86c9f 100644<br>
--- a/src/compiler/nir/nir_intrinsics.h<br>
+++ b/src/compiler/nir/nir_intrinsics.h<br>
@@ -304,6 +304,7 @@ SYSTEM_VALUE(work_group_id, 3, 0, xx, xx, xx)<br>
 SYSTEM_VALUE(user_clip_plane, 4, 1, UCP_ID, xx, xx)<br>
 SYSTEM_VALUE(num_work_groups, 3, 0, xx, xx, xx)<br>
 SYSTEM_VALUE(helper_invocation, 1, 0, xx, xx, xx)<br>
+SYSTEM_VALUE(channel_num, 1, 0, xx, xx, xx)<br></blockquote><div><br></div><div>Might be good to make this channel_num_i965 since it is back-end specific.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
 /*<br>
  * Load operations pull data from some piece of GPU memory.  All load<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp<br>
index 954bfab..c9e4b3c 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp<br>
@@ -3881,6 +3881,21 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr<br>
       break;<br>
    }<br>
<br>
+   case nir_intrinsic_load_channel_num: {<br>
+      fs_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_UW);<br>
+      dest = retype(dest, BRW_REGISTER_TYPE_UD);<br>
+      const fs_builder allbld8 = bld.group(8, 0).exec_all();<br>
+      allbld8.MOV(tmp, brw_imm_v(0x76543210));<br>
+      if (dispatch_width > 8)<br>
+         allbld8.ADD(byte_offset(tmp, 16), tmp, brw_imm_uw(8u));<br>
+      if (dispatch_width > 16) {<br>
+         const fs_builder allbld16 = bld.group(16, 0).exec_all();<br>
+         allbld16.ADD(byte_offset(tmp, 32), tmp, brw_imm_uw(16u));<br>
+      }<br>
+      bld.MOV(dest, tmp);<br>
+      break;<br>
+   }<br>
+<br>
    default:<br>
       unreachable("unknown intrinsic");<br>
    }<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.8.1<br>
<br>
_______________________________________________<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/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>