From: Ian Romanick Date: Sat, 6 Oct 2018 01:22:41 +0000 (-0500) Subject: nir: Add a saturated unsigned integer add opcode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=090e28240795ce83ef63f2da768a80ca65b03ec7;p=mesa.git nir: Add a saturated unsigned integer add opcode Reviewed-by: Jason Ekstrand --- diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index ac2bb9cf711..5458ddd8198 100644 --- a/src/compiler/nir/nir_opcodes.py +++ b/src/compiler/nir/nir_opcodes.py @@ -462,6 +462,8 @@ def binop_reduce(name, output_size, output_type, src_type, prereduce_expr, binop("fadd", tfloat, commutative + associative, "src0 + src1") binop("iadd", tint, commutative + associative, "src0 + src1") +binop("uadd_sat", tuint, commutative, + "(src0 + src1) < src0 ? UINT64_MAX : (src0 + src1)") binop("fsub", tfloat, "", "src0 - src1") binop("isub", tint, "", "src0 - src1")