summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-03-28 11:47:27 -0700
committerJason Ekstrand <[email protected]>2016-03-28 13:07:39 -0700
commit5d9afb65a60f022af0daddbb21bc57bb2c830606 (patch)
tree0febc47e30a2d55c625ae6df8db84ac08ee6952c /src/mesa
parent035f66025b4d82ce40573da86bde6afda4a05ec7 (diff)
i965/peephole_ffma: Only match a mul+add if none of the ops are exact
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c b/src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c
index 6e8b1f99505..22ff2e3c9f8 100644
--- a/src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c
+++ b/src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c
@@ -84,6 +84,17 @@ get_mul_for_src(nir_alu_src *src, int num_components,
return NULL;
nir_alu_instr *alu = nir_instr_as_alu(instr);
+
+ /* We want to bail if any of the other ALU operations involved is labled
+ * exact. One reason for this is that, while the value that is changing is
+ * actually the result of the add and not the multiply, the intention of
+ * the user when they specify an exact multiply is that they want *that*
+ * value and what they don't care about is the add. Another reason is that
+ * SPIR-V explicitly requires this behaviour.
+ */
+ if (alu->exact)
+ return NULL;
+
switch (alu->op) {
case nir_op_imov:
case nir_op_fmov: