summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_algebraic.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/nir/nir_algebraic.py')
-rw-r--r--src/compiler/nir/nir_algebraic.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py
index 3b136f800d4..783d0b69285 100644
--- a/src/compiler/nir/nir_algebraic.py
+++ b/src/compiler/nir/nir_algebraic.py
@@ -1158,6 +1158,7 @@ ${pass_name}_block(nir_builder *build, nir_block *block,
const uint16_t *states, const bool *condition_flags)
{
bool progress = false;
+ const unsigned execution_mode = build->shader->info.float_controls_execution_mode;
nir_foreach_instr_reverse_safe(instr, block) {
if (instr->type != nir_instr_type_alu)
@@ -1167,6 +1168,7 @@ ${pass_name}_block(nir_builder *build, nir_block *block,
if (!alu->dest.dest.is_ssa)
continue;
+ unsigned bit_size = alu->dest.dest.ssa.bit_size;
switch (states[alu->dest.dest.ssa.index]) {
% for i in range(len(automaton.state_patterns)):
case ${i}:
@@ -1174,6 +1176,9 @@ ${pass_name}_block(nir_builder *build, nir_block *block,
for (unsigned i = 0; i < ARRAY_SIZE(${pass_name}_state${i}_xforms); i++) {
const struct transform *xform = &${pass_name}_state${i}_xforms[i];
if (condition_flags[xform->condition_offset] &&
+ !(xform->search->inexact &&
+ (nir_is_float_control_signed_zero_inf_nan_preserve(execution_mode, bit_size) ||
+ nir_is_denorm_flush_to_zero(execution_mode, bit_size))) &&
nir_replace_instr(build, alu, xform->search, xform->replace)) {
progress = true;
break;