summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2018-10-05 20:22:41 -0500
committerJason Ekstrand <jason@jlekstrand.net>2018-12-13 17:49:48 +0000
commit090e28240795ce83ef63f2da768a80ca65b03ec7 (patch)
treee0b70068af0f5b44b96245ec3527491d9778266c
parent39198a1238c967f17a6c3d701fe215315ecbab69 (diff)
nir: Add a saturated unsigned integer add opcode
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
-rw-r--r--src/compiler/nir/nir_opcodes.py2
1 files changed, 2 insertions, 0 deletions
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")