summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_opcodes.py
diff options
context:
space:
mode:
authorDaniel Schürmann <[email protected]>2018-04-13 15:04:16 +0200
committerBas Nieuwenhuizen <[email protected]>2018-04-14 00:52:22 +0200
commit4d802df3aac353970aae93699223fb15b24f8408 (patch)
tree8664e899d0be1c2a24c3e313e45a666d3130e95a /src/compiler/nir/nir_opcodes.py
parent1098c18af3f432968be9c46a2be0ff7f420060d7 (diff)
nir: subgroups instructions for 64bit ballot sizes
Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_opcodes.py')
-rw-r--r--src/compiler/nir/nir_opcodes.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
index a762fdd2201..89a6c6becc2 100644
--- a/src/compiler/nir/nir_opcodes.py
+++ b/src/compiler/nir/nir_opcodes.py
@@ -308,17 +308,17 @@ dst = 0;
for (unsigned bit = 0; bit < 32; bit++)
dst |= ((src0 >> bit) & 1) << (31 - bit);
""")
-unop("bit_count", tuint32, """
+unop_convert("bit_count", tuint32, tuint, """
dst = 0;
-for (unsigned bit = 0; bit < 32; bit++) {
+for (unsigned bit = 0; bit < bit_size; bit++) {
if ((src0 >> bit) & 1)
dst++;
}
""")
-unop_convert("ufind_msb", tint32, tuint32, """
+unop_convert("ufind_msb", tint32, tuint, """
dst = -1;
-for (int bit = 31; bit >= 0; bit--) {
+for (int bit = bit_size - 1; bit >= 0; bit--) {
if ((src0 >> bit) & 1) {
dst = bit;
break;
@@ -340,9 +340,9 @@ for (int bit = 31; bit >= 0; bit--) {
}
""")
-unop("find_lsb", tint32, """
+unop_convert("find_lsb", tint32, tint, """
dst = -1;
-for (unsigned bit = 0; bit < 32; bit++) {
+for (unsigned bit = 0; bit < bit_size; bit++) {
if ((src0 >> bit) & 1) {
dst = bit;
break;