diff options
author | Daniel Schürmann <[email protected]> | 2019-05-02 15:28:59 +0200 |
---|---|---|
committer | Daniel Schürmann <[email protected]> | 2019-06-24 18:42:20 +0200 |
commit | 1403c3a7bff43d37cd4bb10e4f31927597af894a (patch) | |
tree | dd7dea12fbcaed7fd00b48f4c963541701dbb49d | |
parent | 4eeb49ea71e47899f5d9a51b8f3e1fd9762fa7ad (diff) |
nir/algebraic: Use unsigned comparison when lowering bitfield insert/extract
This lets us use the optimization pattern
(('ult', 31, ('iand', b, 31)), False) to remove the
bcsel instruction for code originating in D3D shaders.
Reviewed-by: Connor Abbott <[email protected]>
-rw-r--r-- | src/compiler/nir/nir_opt_algebraic.py | 4 |
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 6e660dfdc02..0d21696273a 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -782,7 +782,7 @@ optimizations.extend([ (('usub_borrow@32', a, b), ('b2i', ('ult', a, b)), 'options->lower_usub_borrow'), (('bitfield_insert', 'base', 'insert', 'offset', 'bits'), - ('bcsel', ('ilt', 31, 'bits'), 'insert', + ('bcsel', ('ult', 31, 'bits'), 'insert', ('bfi', ('bfm', 'bits', 'offset'), 'insert', 'base')), 'options->lower_bitfield_insert'), (('ihadd', a, b), ('iadd', ('iand', a, b), ('ishr', ('ixor', a, b), 1)), 'options->lower_hadd'), @@ -800,7 +800,7 @@ optimizations.extend([ 'options->lower_bitfield_insert_to_shifts'), (('ibitfield_extract', 'value', 'offset', 'bits'), - ('bcsel', ('ilt', 31, 'bits'), 'value', + ('bcsel', ('ult', 31, 'bits'), 'value', ('ibfe', 'value', 'offset', 'bits')), 'options->lower_bitfield_extract'), |