aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-09 21:02:51 -0400
committerMarge Bot <[email protected]>2020-03-10 19:25:59 +0000
commit5a5896cd76629ed2a2cd87ecdcc1f8a723280cae (patch)
tree2b7cd2638cc8483c94fa14c6fe5eeeb0d51eb2c1 /src
parent48e50efd5de7b9ad79f89ba5183a1f45214d501d (diff)
pan/bi: Implement fsat as mov.sat
Soon we'll have a NIR support to handle this the Right Way along with pos and sat_signed support, but we'll always need the fallback anyway. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4139>
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 8068825b826..bbc3398602c 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -231,6 +231,7 @@ bi_class_for_nir_alu(nir_op op)
switch (op) {
case nir_op_fadd: return BI_ADD;
case nir_op_fmul: return BI_FMA;
+ case nir_op_fsat:
case nir_op_mov: return BI_MOV;
default: unreachable("Unknown ALU op");
}
@@ -302,6 +303,9 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr)
case nir_op_fmul:
alu.src[2] = BIR_INDEX_ZERO; /* FMA */
break;
+ case nir_op_fsat:
+ alu.outmod = BIFROST_SAT; /* MOV */
+ break;
default:
break;
}