nvir/nir: nir expects the shift amount to wrap, rather than clamp
authorBen Skeggs <bskeggs@redhat.com>
Sat, 6 Jun 2020 23:52:17 +0000 (09:52 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 10 Jun 2020 22:52:41 +0000 (22:52 +0000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5377>

src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp

index 21d3033cdc2187b00ddb75521c74e833d0c598e7..1ed34ae26528631223c280c62158edb491c8e5be 100644 (file)
@@ -571,6 +571,10 @@ Converter::getSubOp(nir_op op)
    case nir_op_imul_high:
    case nir_op_umul_high:
       return NV50_IR_SUBOP_MUL_HIGH;
+   case nir_op_ishl:
+   case nir_op_ishr:
+   case nir_op_ushr:
+      return NV50_IR_SUBOP_SHIFT_WRAP;
    default:
       return 0;
    }