(('fdot3', a, b), ('fdot_replicated3', a, b), 'options->fdot_replicates'),
(('fdot4', a, b), ('fdot_replicated4', a, b), 'options->fdot_replicates'),
(('fdph', a, b), ('fdph_replicated', a, b), 'options->fdot_replicates'),
+
+ (('b2f(is_used_more_than_once)', ('inot', a)), ('bcsel', a, 0.0, 1.0)),
+ (('fneg(is_used_more_than_once)', ('b2f', ('inot', a))), ('bcsel', a, -0.0, -1.0)),
]
print nir_algebraic.AlgebraicPass("nir_opt_algebraic", optimizations).render()
return true;
}
+static inline bool
+is_used_more_than_once(nir_alu_instr *instr)
+{
+ bool zero_if_use = list_empty(&instr->dest.dest.ssa.if_uses);
+ bool zero_use = list_empty(&instr->dest.dest.ssa.uses);
+
+ if (zero_use && zero_if_use)
+ return false;
+ else if (zero_use && list_is_singular(&instr->dest.dest.ssa.if_uses))
+ return false;
+ else if (zero_if_use && list_is_singular(&instr->dest.dest.ssa.uses))
+ return false;
+
+ return true;
+}
+
#endif /* _NIR_SEARCH_ */