<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Aug 17, 2016 at 3:03 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">According to Connor, it's safe to assume that the first operand of<br>
bcsel, as well as the operand of b2f and b2i, must be well formed<br>
booleans.<br></blockquote><div><br></div><div>Connor is *probably* right... I'm personally still a bit skeptical that this won't bite us in practice since we have no way to validate it.<br><br></div><div>Patches 1-3 are definitely<br><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><br></div><div>Go ahead and put my R-B on this patch if you want. We can revert it if it causes trouble. :)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="https://lists.freedesktop.org/archives/mesa-dev/2016-August/125658.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/mesa-dev/2016-August/<wbr>125658.html</a><br>
<br>
With the previous improvements to a@bool handling, this now has no<br>
change in shader-db instruction counts on Broadwell.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
src/compiler/nir/nir_opt_<wbr>algebraic.py | 6 +++---<br>
1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/compiler/nir/nir_opt_<wbr>algebraic.py b/src/compiler/nir/nir_opt_<wbr>algebraic.py<br>
index 0f0896b..ceb8730 100644<br>
--- a/src/compiler/nir/nir_opt_<wbr>algebraic.py<br>
+++ b/src/compiler/nir/nir_opt_<wbr>algebraic.py<br>
@@ -144,7 +144,7 @@ optimizations = [<br>
(('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)),<br>
(('bcsel', ('flt', b, a), b, a), ('fmin', a, b)),<br>
(('bcsel', ('flt', a, b), b, a), ('fmax', a, b)),<br>
- (('bcsel', ('inot', 'a@bool'), b, c), ('bcsel', a, c, b)),<br>
+ (('bcsel', ('inot', a), b, c), ('bcsel', a, c, b)),<br>
(('bcsel', a, ('bcsel', a, b, c), d), ('bcsel', a, b, d)),<br>
(('bcsel', a, True, 'b@bool'), ('ior', a, b)),<br>
(('fmin', a, a), a),<br>
@@ -248,8 +248,8 @@ optimizations = [<br>
(('ine', 'a@bool', True), ('inot', a)),<br>
(('ine', 'a@bool', False), a),<br>
(('ieq', 'a@bool', False), ('inot', 'a')),<br>
- (('bcsel', a, True, False), ('ine', a, 0)),<br>
- (('bcsel', a, False, True), ('ieq', a, 0)),<br>
+ (('bcsel', a, True, False), a),<br>
+ (('bcsel', a, False, True), ('inot', a)),<br>
(('bcsel', True, b, c), b),<br>
(('bcsel', False, b, c), c),<br>
# The result of this should be hit by constant propagation and, in the<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.9.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>