Draft: nir: split ffma
This will allow us to track better the intent of the original source and enable more optimizations depending on hardware support.
Also this will be useful for OpenCL where the spec requires ffma to be fused and a * b + c
to be unfused except -cl-mad-enable
was added to the compiler options.
TODOS:
-
in glsl_to_nir we should emit nir_op_fmad
for hardware withoutnir_op_ffma
support forfma
. -
wire up nir_op_fmad
in more drivers supporting it. -
Find solution for drivers wanting to support neither, but keep nir_op_ffma
around -
Find solution for drivers having both, but has a strong preference on one. E.g. nir_op_fmad
being faster on some AMD hardware. -
Splitting up nir_op_ffma
first doing optimizations and merging it back can result in better codegen.
Edited by Karol Herbst