Mesa (main): pan/bi: Handle fsat_signed and fclamp_pos
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 15 20:41:30 UTC 2021
Module: Mesa
Branch: main
Commit: ecd9a3fed5dff3997cc279468b816dfac281fc76
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ecd9a3fed5dff3997cc279468b816dfac281fc76
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Thu Jun 10 20:37:12 2021 -0400
pan/bi: Handle fsat_signed and fclamp_pos
Translates to Mali-specific clamps.
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11327>
---
src/panfrost/bifrost/bifrost_compile.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 90d396add99..907bf13f3ac 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -1784,6 +1784,18 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
break;
}
+ case nir_op_fsat_signed: {
+ bi_instr *I = bi_fadd_to(b, sz, dst, s0, bi_negzero(), BI_ROUND_NONE);
+ I->clamp = BI_CLAMP_CLAMP_M1_1;
+ break;
+ }
+
+ case nir_op_fclamp_pos: {
+ bi_instr *I = bi_fadd_to(b, sz, dst, s0, bi_negzero(), BI_ROUND_NONE);
+ I->clamp = BI_CLAMP_CLAMP_0_INF;
+ break;
+ }
+
case nir_op_fneg:
bi_fadd_to(b, sz, dst, bi_neg(s0), bi_negzero(), BI_ROUND_NONE);
break;
More information about the mesa-commit
mailing list