mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 07:58:16 +02:00
ir3: Lower ffma
OpenCL requires that ffma is fused, where fmad can be unfused. Rusticl will lower CL ffma for us, but that requires us to set .lower_ffmaN. Late-opts will still re-fuse inexact fmul+fadd, since we are also setting .fuse_ffmaN. https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37807#note_3215155 proposes separate ffma and fmad instructions for the two cases, which would be a cleaner solution. Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40271>
This commit is contained in:
parent
c09d0018a3
commit
ec18b2d28a
1 changed files with 10 additions and 0 deletions
|
|
@ -130,6 +130,16 @@ static const nir_shader_compiler_options ir3_base_options = {
|
|||
.lower_usub_borrow = true,
|
||||
.lower_mul_high = true,
|
||||
.lower_mul_2x32_64 = true,
|
||||
/* ir3's mad is an unfused mul-add instruction, so we need to flag fma
|
||||
* lowering so that CL can implement fused fma in software. GLSL,
|
||||
* SPIRV, and NIR don't require either fused or unfused behavior from
|
||||
* fma, and we'll turn mul+adds back into nir_op_ffma (again, implemented
|
||||
* as unfused) during nir_opt_algebraic_late() (assuming it's not
|
||||
* decorated with GLSL's precise, or SPIRV's NoContraction).
|
||||
*/
|
||||
.lower_ffma16 = true,
|
||||
.lower_ffma32 = true,
|
||||
.lower_ffma64 = true,
|
||||
.fuse_ffma16 = true,
|
||||
.fuse_ffma32 = true,
|
||||
.fuse_ffma64 = true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue