<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 10, 2018 at 7:37 AM, Daniel Schürmann <span dir="ltr"><<a href="mailto:daniel.schuermann@campus.tu-berlin.de" target="_blank">daniel.schuermann@campus.tu-berlin.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
src/compiler/nir/nir_lower_<wbr>subgroups.c | 5 ++---<br>
src/compiler/nir/nir_opcodes.<wbr>py | 12 ++++++------<br>
2 files changed, 8 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/src/compiler/nir/nir_lower_<wbr>subgroups.c b/src/compiler/nir/nir_lower_<wbr>subgroups.c<br>
index 0d3c83b795..9dc7be7947 100644<br>
--- a/src/compiler/nir/nir_lower_<wbr>subgroups.c<br>
+++ b/src/compiler/nir/nir_lower_<wbr>subgroups.c<br>
@@ -357,9 +357,8 @@ lower_subgroups_intrin(nir_<wbr>builder *b, nir_intrinsic_instr *intrin,<br>
switch (intrin->intrinsic) {<br>
case nir_intrinsic_ballot_bitfield_<wbr>extract:<br>
assert(intrin->src[1].is_ssa);<br>
- return nir_i2b(b, nir_iand(b, nir_ushr(b, int_val,<br>
- intrin->src[1].ssa),<br>
- nir_imm_int(b, 1)));<br>
+ return nir_i2b(b, nir_iand(b, nir_ushr(b, int_val, intrin->src[1].ssa),<br>
+ nir_imm_intN_t(b, 1, options->ballot_bit_size)));<br></blockquote><div><br></div><div>Oops. This didn't automatically scale as I intended. :-/ The indentation seems a bit weird but there's not much you can do. This hunk (as it's own patch) looks good.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
case nir_intrinsic_ballot_bit_<wbr>count_reduce:<br>
return nir_bit_count(b, int_val);<br>
case nir_intrinsic_ballot_find_lsb:<br>
diff --git a/src/compiler/nir/nir_<wbr>opcodes.py b/src/compiler/nir/nir_<wbr>opcodes.py<br>
index a762fdd220..89a6c6becc 100644<br>
--- a/src/compiler/nir/nir_<wbr>opcodes.py<br>
+++ b/src/compiler/nir/nir_<wbr>opcodes.py<br>
@@ -308,17 +308,17 @@ dst = 0;<br>
for (unsigned bit = 0; bit < 32; bit++)<br>
dst |= ((src0 >> bit) & 1) << (31 - bit);<br>
""")<br>
-unop("bit_count", tuint32, """<br>
+unop_convert("bit_count", tuint32, tuint, """<br>
dst = 0;<br>
-for (unsigned bit = 0; bit < 32; bit++) {<br>
+for (unsigned bit = 0; bit < bit_size; bit++) {<br>
if ((src0 >> bit) & 1)<br>
dst++;<br>
}<br>
""")<br>
<br>
-unop_convert("ufind_msb", tint32, tuint32, """<br>
+unop_convert("ufind_msb", tint32, tuint, """<br>
dst = -1;<br>
-for (int bit = 31; bit >= 0; bit--) {<br>
+for (int bit = bit_size - 1; bit >= 0; bit--) {<br>
if ((src0 >> bit) & 1) {<br>
dst = bit;<br>
break;<br>
@@ -340,9 +340,9 @@ for (int bit = 31; bit >= 0; bit--) {<br>
}<br>
""")<br>
<br>
-unop("find_lsb", tint32, """<br>
+unop_convert("find_lsb", tint32, tint, """<br>
dst = -1;<br>
-for (unsigned bit = 0; bit < 32; bit++) {<br>
+for (unsigned bit = 0; bit < bit_size; bit++) {<br></blockquote><div><br></div><div>These three changes should probably be their own patch. They look fine to me though.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
if ((src0 >> bit) & 1) {<br>
dst = bit;<br>
break;<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>