Mesa (master): Revert MR 369 (Fix extract_i8 and extract_u8 for 64-bit integers)

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Mar 9 09:43:47 UTC 2019


Module: Mesa
Branch: master
Commit: da51e3f1b01b193360f87f29327bf3c0eded8f7a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=da51e3f1b01b193360f87f29327bf3c0eded8f7a

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Sat Mar  9 01:39:20 2019 -0800

Revert MR 369 (Fix extract_i8 and extract_u8 for 64-bit integers)

This broke piles of image load store tests (179 failures on CI,
mesa_master build #15546, previous build right before this landed
was green).  I'd rather not leave the tree on fire over the weekend,
so let's revert for now, and we can figure out what happened next week.

---

 src/compiler/nir/nir_opt_algebraic.py | 34 ++++++++++------------------------
 1 file changed, 10 insertions(+), 24 deletions(-)

diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index 218dacf4031..5b2e7ee2405 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -604,32 +604,18 @@ optimizations = [
                            ('unpack_64_2x32_split_y', a)), a),
 
    # Byte extraction
-   (('ushr', 'a at 16',  8), ('extract_u8', a, 1), '!options->lower_extract_byte'),
+   (('ushr', ('ishl', 'a at 32', 24), 24), ('extract_u8', a, 0), '!options->lower_extract_byte'),
+   (('ushr', ('ishl', 'a at 32', 16), 24), ('extract_u8', a, 1), '!options->lower_extract_byte'),
+   (('ushr', ('ishl', 'a at 32', 8), 24), ('extract_u8', a, 2), '!options->lower_extract_byte'),
    (('ushr', 'a at 32', 24), ('extract_u8', a, 3), '!options->lower_extract_byte'),
-   (('ushr', 'a at 64', 56), ('extract_u8', a, 7), '!options->lower_extract_byte'),
-   (('ishr', 'a at 16',  8), ('extract_i8', a, 1), '!options->lower_extract_byte'),
+   (('ishr', ('ishl', 'a at 32', 24), 24), ('extract_i8', a, 0), '!options->lower_extract_byte'),
+   (('ishr', ('ishl', 'a at 32', 16), 24), ('extract_i8', a, 1), '!options->lower_extract_byte'),
+   (('ishr', ('ishl', 'a at 32', 8), 24), ('extract_i8', a, 2), '!options->lower_extract_byte'),
    (('ishr', 'a at 32', 24), ('extract_i8', a, 3), '!options->lower_extract_byte'),
-   (('ishr', 'a at 64', 56), ('extract_i8', a, 7), '!options->lower_extract_byte'),
-   (('iand', 0xff, a), ('extract_u8', a, 0), '!options->lower_extract_byte')
-]
-
-# After the ('extract_u8', a, 0) pattern, above, triggers, there will be
-# patterns like those below.
-for op in ('ushr', 'ishr'):
-   optimizations.extend([(('extract_u8', (op, 'a at 16',  8),     0), ('extract_u8', a, 1))])
-   optimizations.extend([(('extract_u8', (op, 'a at 32',  8 * i), 0), ('extract_u8', a, i)) for i in range(1, 4)])
-   optimizations.extend([(('extract_u8', (op, 'a at 64',  8 * i), 0), ('extract_u8', a, i)) for i in range(1, 8)])
-
-optimizations.extend([(('extract_u8', ('extract_u16', a, 1), 0), ('extract_u8', a, 2))])
+   (('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'),
 
-# After the ('extract_[iu]8', a, 3) patterns, above, trigger, there will be
-# patterns like those below.
-for op in ('extract_u8', 'extract_i8'):
-   optimizations.extend([((op, ('ishl', 'a at 16',      8),     1), ('extract_u8', a, 0))])
-   optimizations.extend([((op, ('ishl', 'a at 32', 24 - 8 * i), 3), ('extract_u8', a, i)) for i in range(2, -1, -1)])
-   optimizations.extend([((op, ('ishl', 'a at 64', 56 - 8 * i), 7), ('extract_u8', a, i)) for i in range(6, -1, -1)])
-
-optimizations.extend([
     # Word extraction
    (('ushr', ('ishl', 'a at 32', 16), 16), ('extract_u16', a, 0), '!options->lower_extract_word'),
    (('ushr', 'a at 32', 16), ('extract_u16', a, 1), '!options->lower_extract_word'),
@@ -812,7 +798,7 @@ optimizations.extend([
      'options->lower_unpack_snorm_4x8'),
 
    (('isign', a), ('imin', ('imax', a, -1), 1), 'options->lower_isign'),
-])
+]
 
 # bit_size dependent lowerings
 for bit_size in [8, 16, 32, 64]:




More information about the mesa-commit mailing list