pan/mdg: Lower ufind_msb, poorly
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
This commit is contained in:
parent
36248dd448
commit
4a2f128985
|
@ -71,6 +71,12 @@ algebraic_late = [
|
||||||
(('fmul', a, 2.0), ('fadd', a, a))
|
(('fmul', a, 2.0), ('fadd', a, a))
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Size conversion is redundant to Midgard but needed for NIR, and writing this
|
||||||
|
# lowering in MIR would be painful without a competent builder, so eat the
|
||||||
|
# extra instruction
|
||||||
|
for sz in ('8', '16', '32'):
|
||||||
|
converted = ('u2u32', a) if sz != '32' else a
|
||||||
|
algebraic_late += [(('ufind_msb', 'a@' + sz), ('isub', 31, ('uclz', converted)))]
|
||||||
|
|
||||||
# Midgard is able to type convert down by only one "step" per instruction; if
|
# Midgard is able to type convert down by only one "step" per instruction; if
|
||||||
# NIR wants more than one step, we need to break up into multiple instructions.
|
# NIR wants more than one step, we need to break up into multiple instructions.
|
||||||
|
|
Loading…
Reference in New Issue