mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 11:38:05 +02:00
nir/algebraic: Be more careful converting ushr to extract_u8/16
If it's not the right bit-size, it may not actually be the correct extraction. For now, we'll only worry about 32-bit versions. Fixes:905ff86198"nir: Recognize open-coded extract_u16" Fixes:76289fbfa8"nir: Recognize open-coded extract_u8" Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit116b47fe3c)
This commit is contained in:
parent
8c3aee4038
commit
16d44d1e98
1 changed files with 2 additions and 2 deletions
|
|
@ -427,13 +427,13 @@ optimizations = [
|
|||
('unpack_64_2x32_split_y', a)), a),
|
||||
|
||||
# Byte extraction
|
||||
(('ushr', a, 24), ('extract_u8', a, 3), '!options->lower_extract_byte'),
|
||||
(('ushr', 'a@32', 24), ('extract_u8', a, 3), '!options->lower_extract_byte'),
|
||||
(('iand', 0xff, ('ushr', a, 16)), ('extract_u8', a, 2), '!options->lower_extract_byte'),
|
||||
(('iand', 0xff, ('ushr', a, 8)), ('extract_u8', a, 1), '!options->lower_extract_byte'),
|
||||
(('iand', 0xff, a), ('extract_u8', a, 0), '!options->lower_extract_byte'),
|
||||
|
||||
# Word extraction
|
||||
(('ushr', a, 16), ('extract_u16', a, 1), '!options->lower_extract_word'),
|
||||
(('ushr', 'a@32', 16), ('extract_u16', a, 1), '!options->lower_extract_word'),
|
||||
(('iand', 0xffff, a), ('extract_u16', a, 0), '!options->lower_extract_word'),
|
||||
|
||||
# Subtracts
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue