From 5487847d8c75b40ef53d881c9abe0afcca378e26 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 2 Mar 2021 13:14:27 +0100 Subject: [PATCH] pan/bi: Implement u{add, sub}_sat Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 727dd304363..cea08011765 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -1897,6 +1897,10 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr) bi_iadd_to(b, nir_type_int, sz, dst, s0, s1, true); break; + case nir_op_uadd_sat: + bi_iadd_to(b, nir_type_uint, sz, dst, s0, s1, true); + break; + case nir_op_ihadd: bi_hadd_to(b, nir_type_int, sz, dst, s0, s1, BI_ROUND_RTN); break; @@ -1913,6 +1917,10 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr) bi_isub_to(b, nir_type_int, sz, dst, s0, s1, true); break; + case nir_op_usub_sat: + bi_isub_to(b, nir_type_uint, sz, dst, s0, s1, true); + break; + case nir_op_imul: bi_imul_to(b, sz, dst, s0, s1); break;