mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 06:20:19 +01:00
nir: add fisnormal lowering
just lower the 32-bit version for now. Thanks to alyssa for this suggested lowering. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12207>
This commit is contained in:
parent
330e28155f
commit
ad92c2b253
2 changed files with 6 additions and 0 deletions
|
|
@ -3427,6 +3427,8 @@ typedef struct nir_shader_compiler_options {
|
|||
bool lower_fneg;
|
||||
/** lowers ineg to isub. Driver must call nir_opt_algebraic_late(). */
|
||||
bool lower_ineg;
|
||||
/** lowers fisnormal to alu ops. */
|
||||
bool lower_fisnormal;
|
||||
|
||||
/* lower {slt,sge,seq,sne} to {flt,fge,feq,fneu} + b2f: */
|
||||
bool lower_scmp;
|
||||
|
|
|
|||
|
|
@ -2143,6 +2143,10 @@ for op in ['ineg', 'iabs', 'inot', 'isign']:
|
|||
((op, ('bcsel', c, '#a', '#b')), ('bcsel', c, (op, a), (op, b))),
|
||||
]
|
||||
|
||||
optimizations.extend([
|
||||
(('fisnormal', 'a@32'), ('ult', 0x1ffffff, ('iadd', ('ishl', a, 1), 0x1000000)), 'options->lower_fisnormal')
|
||||
])
|
||||
|
||||
# This section contains optimizations to propagate downsizing conversions of
|
||||
# constructed vectors into vectors of downsized components. Whether this is
|
||||
# useful depends on the SIMD semantics of the backend. On a true SIMD machine,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue