<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 4, 2018 at 1:19 AM Iago Toral Quiroga <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">---<br>
src/intel/compiler/brw_fs_nir.cpp | 25 +++++++++++++++++++++----<br>
1 file changed, 21 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp<br>
index db3a8812ae3..7a4594a24ac 100644<br>
--- a/src/intel/compiler/brw_fs_nir.cpp<br>
+++ b/src/intel/compiler/brw_fs_nir.cpp<br>
@@ -1063,11 +1063,28 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr)<br>
* Predicated OR sets 1 if val is positive.<br>
*/<br>
uint32_t bit_size = nir_dest_bit_size(instr->dest.dest);<br>
- assert(bit_size == 32 || bit_size == 16);<br>
<br>
- fs_reg zero = bit_size == 32 ? brw_imm_d(0) : brw_imm_w(0);<br>
- fs_reg one = bit_size == 32 ? brw_imm_d(1) : brw_imm_w(1);<br>
- fs_reg shift = bit_size == 32 ? brw_imm_d(31) : brw_imm_w(15);<br>
+ fs_reg zero, one, shift;<br>
+ switch (bit_size) {<br>
+ case 32:<br>
+ zero = brw_imm_d(0);<br>
+ one = brw_imm_d(1);<br>
+ shift = brw_imm_d(31);<br>
+ break;<br>
+ case 16:<br>
+ zero = brw_imm_w(0);<br>
+ one = brw_imm_w(1);<br>
+ shift = brw_imm_w(15);<br>
+ break;<br>
+ case 8: {<br>
+ zero = setup_imm_b(bld, 0);<br>
+ one = setup_imm_b(bld, 1);<br>
+ shift = setup_imm_b(bld, 7);<br>
+ break;<br>
+ }<br>
+ default:<br>
+ unreachable("unsupported bit-size");<br>
+ };<br>
<br>
bld.CMP(bld.null_reg_d(), op[0], zero, BRW_CONDITIONAL_G);<br>
bld.ASR(result, op[0], shift);<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<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>
</blockquote></div>