mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
pan/mdg: Ingest fsat_signed/fclamp_pos
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5102>
This commit is contained in:
parent
22bb5a9acb
commit
24e2e24dc0
2 changed files with 9 additions and 0 deletions
|
|
@ -770,6 +770,8 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr)
|
|||
ALU_CASE(fabs, fmov);
|
||||
ALU_CASE(fneg, fmov);
|
||||
ALU_CASE(fsat, fmov);
|
||||
ALU_CASE(fsat_signed, fmov);
|
||||
ALU_CASE(fclamp_pos, fmov);
|
||||
|
||||
/* For size conversion, we use a move. Ideally though we would squash
|
||||
* these ops together; maybe that has to happen after in NIR as part of
|
||||
|
|
|
|||
|
|
@ -45,6 +45,13 @@ algebraic_late = [
|
|||
|
||||
(('b32csel', a, 'b@32', 0), ('iand', a, b)),
|
||||
(('b32csel', a, 0, 'b@32'), ('iand', ('inot', a), b)),
|
||||
|
||||
# Fuse sat_signed. This should probably be shared with Bifrost
|
||||
(('~fmin', ('fmax', a, -1.0), 1.0), ('fsat_signed', a)),
|
||||
(('~fmax', ('fmin', a, 1.0), -1.0), ('fsat_signed', a)),
|
||||
|
||||
# Fuse clamp_positive. This should probably be shared with Utgard/bifrost
|
||||
(('fmax', a, 0.0), ('fclamp_pos', a)),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue