<div dir="ltr"><div>I do not think this patch does what you think it does.  The old opcode allowed you to shift any bit size integer by a 32-bit integer.  The new version allows you to shift N bits by N bits.  In particular, you can't shift a 16-bit by a 32-bit value.<br><br></div>I'm not sure what the best thing is to do here.  Really, the size of src1 doesn't really matter as 8-bit is enough to do any shifting needed for a 64-bit src0.  You can always compose with a u2u32 to get any src1 bit size you want.  We picked 32 because it's been the GL default for a long time.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 28, 2018 at 11:51 AM, Rob Clark <span dir="ltr"><<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Karol Herbst <<a href="mailto:kherbst@redhat.com">kherbst@redhat.com</a>><br>
<br>
This is a thing for OpenCL kernels.<br>
<br>
Signed-off-by: Rob Clark <<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>><br>
---<br>
 src/compiler/nir/nir_opcodes.<wbr>py | 6 +++---<br>
 1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/compiler/nir/nir_<wbr>opcodes.py b/src/compiler/nir/nir_<wbr>opcodes.py<br>
index 278562b2bd1..c4d2c7805eb 100644<br>
--- a/src/compiler/nir/nir_<wbr>opcodes.py<br>
+++ b/src/compiler/nir/nir_<wbr>opcodes.py<br>
@@ -479,9 +479,9 @@ binop("seq", tfloat32, commutative, "(src0 == src1) ? 1.0f : 0.0f") # Set on Equ<br>
 binop("sne", tfloat32, commutative, "(src0 != src1) ? 1.0f : 0.0f") # Set on Not Equal<br>
<br>
<br>
-opcode("ishl", 0, tint, [0, 0], [tint, tuint32], "", "src0 << src1")<br>
-opcode("ishr", 0, tint, [0, 0], [tint, tuint32], "", "src0 >> src1")<br>
-opcode("ushr", 0, tuint, [0, 0], [tuint, tuint32], "", "src0 >> src1")<br>
+opcode("ishl", 0, tint, [0, 0], [tint, tuint], "", "src0 << src1")<br>
+opcode("ishr", 0, tint, [0, 0], [tint, tuint], "", "src0 >> src1")<br>
+opcode("ushr", 0, tuint, [0, 0], [tuint, tuint], "", "src0 >> src1")<br>
<br>
 # bitwise logic operators<br>
 #<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.3<br>
<br>
</font></span></blockquote></div><br></div>