summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-08-14 15:10:22 -0500
committerJason Ekstrand <[email protected]>2018-08-29 14:04:02 -0500
commit116b47fe3c0395e95b67c6bd3506ab7d6a83393e (patch)
tree1a2abf937d783ae05296afb06d6693262cf19dab /src
parent40fc4b5acd65b4dcc1f216e605fc84eff695ff4a (diff)
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: 905ff8619824 "nir: Recognize open-coded extract_u16" Fixes: 76289fbfa84a "nir: Recognize open-coded extract_u8" Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/nir/nir_opt_algebraic.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index e770a61d9ff..9c890c0eb24 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -543,13 +543,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