Mesa (master): nir: Add a saturated unsigned integer add opcode

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 13 17:50:22 UTC 2018


Module: Mesa
Branch: master
Commit: 090e28240795ce83ef63f2da768a80ca65b03ec7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=090e28240795ce83ef63f2da768a80ca65b03ec7

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Fri Oct  5 20:22:41 2018 -0500

nir: Add a saturated unsigned integer add opcode

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/compiler/nir/nir_opcodes.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
index ac2bb9cf71..5458ddd819 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")
 




More information about the mesa-commit mailing list