nir: Split the flag for lowering of fabs and fneg to source modifiers.

i915 and r300 have fneg source modifier but not fabs, and doing it in NIR
can save us some backend pain.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14938>
This commit is contained in:
Emma Anholt
2022-02-08 10:07:51 -08:00
parent bd24f418c3
commit f4ee7146f9
2 changed files with 9 additions and 5 deletions
+3 -1
View File
@@ -78,8 +78,10 @@ nir_lower_to_source_mods_block(nir_block *block,
case nir_type_float:
if (!(options & nir_lower_float_source_mods))
continue;
if (parent->op != nir_op_fabs && parent->op != nir_op_fneg)
if (!(parent->op == nir_op_fabs && (options & nir_lower_fabs_source_mods)) &&
!(parent->op == nir_op_fneg && (options & nir_lower_fneg_source_mods))) {
continue;
}
break;
case nir_type_int:
if (!(options & nir_lower_int_source_mods))