nak: port over to nir_op_ffma

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41165>
This commit is contained in:
Karol Herbst 2026-04-23 03:17:42 +02:00 committed by Marge Bot
parent 55596204e4
commit 4307f42b9e
3 changed files with 11 additions and 2 deletions

View file

@ -116,6 +116,12 @@ fn nir_options(dev: &nv_device_info) -> nir_shader_compiler_options {
fuse_ffma16: true,
fuse_ffma32: true,
fuse_ffma64: true,
float_mul_add16: nir_float_muladd_support_has_ffma
| nir_float_muladd_support_fuse,
float_mul_add32: nir_float_muladd_support_has_ffma
| nir_float_muladd_support_fuse,
float_mul_add64: nir_float_muladd_support_has_ffma
| nir_float_muladd_support_fuse,
lower_flrp16: true,
lower_flrp32: true,
lower_flrp64: true,

View file

@ -1056,7 +1056,7 @@ impl<'a> ShaderFromNir<'a> {
b.fexp2(srcs(0)).into()
}
}
nir_op_ffma_old => {
nir_op_ffma | nir_op_ffma_old => {
let ftype = FloatType::from_bits(alu.def.bit_size().into());
let dst;
if alu.def.bit_size() == 64 {
@ -1102,7 +1102,7 @@ impl<'a> ShaderFromNir<'a> {
}
dst
}
nir_op_ffmaz_old => {
nir_op_ffmaz | nir_op_ffmaz_old => {
assert!(alu.def.bit_size() == 32);
// DNZ implies FTZ so we need FTZ set or this is invalid
assert!(self.float_ctl.fp32.ftz);

View file

@ -116,6 +116,7 @@ vectorize_filter_cb(const nir_instr *instr, const void *data)
case nir_op_fneu:
case nir_op_fmul:
case nir_op_fmul_rtz:
case nir_op_ffma:
case nir_op_ffma_old:
case nir_op_fsign:
case nir_op_fsat:
@ -268,6 +269,8 @@ lower_bit_size_cb(const nir_instr *instr, void *data)
case nir_op_fneu:
case nir_op_fmul:
case nir_op_fmul_rtz:
case nir_op_ffma:
case nir_op_ffmaz:
case nir_op_ffma_old:
case nir_op_ffmaz_old:
case nir_op_fsign: