pan/bi: Handle fsat_signed and fclamp_pos

Translates to Mali-specific clamps.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11327>
This commit is contained in:
Alyssa Rosenzweig 2021-06-10 20:37:12 -04:00 committed by Marge Bot
parent 16bf1ae935
commit ecd9a3fed5
1 changed files with 12 additions and 0 deletions

View File

@ -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;