pan/bi: Handle ineg

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10627>
This commit is contained in:
Alyssa Rosenzweig 2021-05-03 18:29:35 -04:00 committed by Marge Bot
parent ab56471955
commit 0906d75479
2 changed files with 5 additions and 7 deletions

View file

@ -1969,6 +1969,10 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
bi_hadd_to(b, nir_type_int, sz, dst, s0, s1, BI_ROUND_RTP);
break;
case nir_op_ineg:
bi_isub_to(b, nir_type_int, sz, dst, bi_zero(), s0, false);
break;
case nir_op_isub:
bi_isub_to(b, nir_type_int, sz, dst, s0, s1, false);
break;

View file

@ -30,13 +30,7 @@ a = 'a'
b = 'b'
c = 'c'
algebraic_late = [
# ineg must be lowered late, but only for integers; floats will try to
# have modifiers attached... hence why this has to be here rather than
# a more standard lower_negate approach
(('ineg', a), ('isub', 0, a)),
]
algebraic_late = []
for isz in ('8', '16', '32'):
for osz in ('16', '32', '64'):