Mesa (main): ir3: Implement [iu]sub_sat.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 13 08:09:58 UTC 2022


Module: Mesa
Branch: main
Commit: d9fb1b05eb94be877c4543c640ca7adf6dd297ec
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d9fb1b05eb94be877c4543c640ca7adf6dd297ec

Author: Georg Lehmann <dadschoorse at gmail.com>
Date:   Tue Jul 12 20:33:49 2022 +0200

ir3: Implement [iu]sub_sat.

Signed-off-by: Georg Lehmann <dadschoorse at gmail.com>
Reviewed-by: Emma Anholt <emma at anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17468>

---

 src/freedreno/ir3/ir3_compiler_nir.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c
index 00d7a0b1b5b..d43f44feb52 100644
--- a/src/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/freedreno/ir3/ir3_compiler_nir.c
@@ -826,6 +826,14 @@ emit_alu(struct ir3_context *ctx, nir_alu_instr *alu)
       dst[0] = ir3_ADD_S(b, src[0], 0, src[1], 0);
       dst[0]->flags |= IR3_INSTR_SAT;
       break;
+   case nir_op_usub_sat:
+      dst[0] = ir3_SUB_U(b, src[0], 0, src[1], 0);
+      dst[0]->flags |= IR3_INSTR_SAT;
+      break;
+   case nir_op_isub_sat:
+      dst[0] = ir3_SUB_S(b, src[0], 0, src[1], 0);
+      dst[0]->flags |= IR3_INSTR_SAT;
+      break;
 
    case nir_op_udot_4x8_uadd:
    case nir_op_udot_4x8_uadd_sat:



More information about the mesa-commit mailing list