diff --git a/src/compiler/nir/tests/fp_class_tests.cpp b/src/compiler/nir/tests/fp_class_tests.cpp index ac50fa75496..68bc59f24f2 100644 --- a/src/compiler/nir/tests/fp_class_tests.cpp +++ b/src/compiler/nir/tests/fp_class_tests.cpp @@ -186,6 +186,11 @@ DEFINE_TEST(fmul, 2) DEFINE_TEST(fmulz, 2) DEFINE_TEST(fpow, 2) DEFINE_TEST(fdot2, 2) +DEFINE_TEST(ffma, 3) +DEFINE_TEST(ffma_weak, 3) +DEFINE_TEST(ffmaz, 3) +DEFINE_TEST(fmad, 3) +DEFINE_TEST(fmadz, 3) DEFINE_TEST(ffma_old, 3) DEFINE_TEST(ffmaz_old, 3) DEFINE_TEST(fabs, 1) diff --git a/src/compiler/nir/tests/nir_opt_varyings_test.h b/src/compiler/nir/tests/nir_opt_varyings_test.h index 32978c1b69c..a7bc43a4782 100644 --- a/src/compiler/nir/tests/nir_opt_varyings_test.h +++ b/src/compiler/nir/tests/nir_opt_varyings_test.h @@ -158,9 +158,9 @@ protected: nir_def *build_uniform_expr(nir_builder *b, unsigned bit_size, unsigned index) { - return nir_fsqrt(b, nir_ffma_old(b, load_uniform(b, bit_size, index), - nir_imm_floatN_t(b, 3.14, bit_size), - load_ubo(b, bit_size, index))); + return nir_fsqrt(b, nir_ffma_weak(b, load_uniform(b, bit_size, index), + nir_imm_floatN_t(b, 3.14, bit_size), + load_ubo(b, bit_size, index))); } bool shader_contains_uniform(nir_builder *target_b, unsigned bit_size, @@ -254,13 +254,13 @@ protected: if (contains) { return shader_contains_uniform(b, bit_size, index) && shader_contains_ubo(b, bit_size, index) && - shader_contains_alu_op(b, nir_op_ffma_old, bit_size) && + shader_contains_alu_op(b, nir_op_ffma_weak, bit_size) && shader_contains_alu_op(b, nir_op_fsqrt, bit_size) && shader_contains_const_float(b, 3.14, bit_size); } else { return !shader_contains_uniform(b, bit_size, index) && !shader_contains_ubo(b, bit_size, index) && - !shader_contains_alu_op(b, nir_op_ffma_old, bit_size) && + !shader_contains_alu_op(b, nir_op_ffma_weak, bit_size) && !shader_contains_alu_op(b, nir_op_fsqrt, bit_size) && !shader_contains_const_float(b, 3.14, bit_size); } @@ -553,8 +553,8 @@ load_interpolated_input_tes(nir_builder *b, gl_varying_slot slot, if (i == 0) def[i] = nir_fmul(b, def[i], nir_channel(b, tesscoord, remap[i])); else - def[i] = nir_ffma_old(b, def[i], nir_channel(b, tesscoord, remap[i]), - def[i - 1]); + def[i] = nir_ffma_weak(b, def[i], nir_channel(b, tesscoord, remap[i]), + def[i - 1]); } else { def[i] = nir_fmul(b, def[i], nir_channel(b, tesscoord, remap[i])); } @@ -650,6 +650,11 @@ movable_across_interp(nir_builder *b, nir_op op, unsigned interp[3], case nir_op_fmul: case nir_op_fmulz: + case nir_op_ffma: + case nir_op_ffma_weak: + case nir_op_ffmaz: + case nir_op_fmad: + case nir_op_fmadz: case nir_op_ffma_old: case nir_op_ffmaz_old: return !divergent[0] || !divergent[1]; diff --git a/src/compiler/nir/tests/serialize_tests.cpp b/src/compiler/nir/tests/serialize_tests.cpp index 92d589d115e..f6989f6ea64 100644 --- a/src/compiler/nir/tests/serialize_tests.cpp +++ b/src/compiler/nir/tests/serialize_tests.cpp @@ -165,7 +165,7 @@ TEST_P(nir_serialize_all_test, alu_vec) TEST_P(nir_serialize_all_test, alu_two_components_full_swizzle) { nir_def *undef = nir_undef(b, 2, 32); - nir_def *fma = nir_ffma_old(b, undef, undef, undef); + nir_def *fma = nir_ffma_weak(b, undef, undef, undef); nir_alu_instr *fma_alu = nir_def_as_alu(fma); fma->num_components = GetParam();