<div dir="ltr"><div>Why not just squash 2 and 3 and call it "Separate 32 and 64-bit fmod lowering" or something like that.<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 28, 2016 at 4:19 AM, Samuel Iglesias Gonsálvez <span dir="ltr"><<a href="mailto:siglesias@igalia.com" target="_blank">siglesias@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A later patch will add lower_fmod64 option to NIR.<br>
<br>
Signed-off-by: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>><br>
---<br>
src/compiler/nir/nir.h | 2 +-<br>
src/compiler/nir/nir_opt_algebraic.py | 4 ++--<br>
src/mesa/drivers/dri/i965/brw_compiler.c | 2 +-<br>
3 files changed, 4 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h<br>
index 2e89bc5..a478124 100644<br>
--- a/src/compiler/nir/nir.h<br>
+++ b/src/compiler/nir/nir.h<br>
@@ -1630,7 +1630,7 @@ typedef struct nir_shader_compiler_options {<br>
bool lower_fpow;<br>
bool lower_fsat;<br>
bool lower_fsqrt;<br>
- bool lower_fmod;<br>
+ bool lower_fmod32;<br>
bool lower_bitfield_extract;<br>
bool lower_bitfield_insert;<br>
bool lower_uadd_carry;<br>
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py<br>
index 60ee170..afe653e 100644<br>
--- a/src/compiler/nir/nir_opt_algebraic.py<br>
+++ b/src/compiler/nir/nir_opt_algebraic.py<br>
@@ -296,8 +296,8 @@ optimizations = [<br>
(('iadd', '#a', ('iadd', b, '#c')), ('iadd', ('iadd', a, c), b)),<br>
<br>
# Misc. lowering<br>
- (('fmod', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod'),<br>
- (('frem', a, b), ('fsub', a, ('fmul', b, ('ftrunc', ('fdiv', a, b)))), 'options->lower_fmod'),<br>
+ (('fmod', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod32'),<br>
+ (('frem', a, b), ('fsub', a, ('fmul', b, ('ftrunc', ('fdiv', a, b)))), 'options->lower_fmod32'),<br>
(('uadd_carry@32', a, b), ('b2i', ('ult', ('iadd', a, b), a)), 'options->lower_uadd_carry'),<br>
(('usub_borrow@32', a, b), ('b2i', ('ult', a, b)), 'options->lower_usub_borrow'),<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_compiler.c b/src/mesa/drivers/dri/i965/brw_compiler.c<br>
index c8a38e3..5ff1a61 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_compiler.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_compiler.c<br>
@@ -76,7 +76,7 @@ shader_perf_log_mesa(void *data, const char *fmt, ...)<br>
.lower_sub = true, \<br>
.lower_fdiv = true, \<br>
.lower_scmp = true, \<br>
- .lower_fmod = true, \<br>
+ .lower_fmod32 = true, \<br>
.lower_bitfield_extract = true, \<br>
.lower_bitfield_insert = true, \<br>
.lower_uadd_carry = true, \<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.0<br>
<br>
_______________________________________________<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/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>