aco: create mads when signed zeros should be preserved
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 15 May 2020 13:24:12 +0000 (14:24 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 15 Jun 2020 18:24:22 +0000 (18:24 +0000)
This check was added because I thought v_mad_f32 didn't preserve the
signess of zero, but I can't reproduce that and this isn't mentioned
anywhere in LLVM.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>

src/amd/compiler/aco_optimizer.cpp

index a07ea8092fc907036c5d057c8e499893a14555c2..37dcb89b182fcd772316594bac42f53721f2a8cf 100644 (file)
@@ -2414,7 +2414,7 @@ void combine_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr
    else if ((instr->opcode == aco_opcode::v_add_f32 ||
              instr->opcode == aco_opcode::v_sub_f32 ||
              instr->opcode == aco_opcode::v_subrev_f32) &&
-            block.fp_mode.denorm32 == 0 && !block.fp_mode.preserve_signed_zero_inf_nan32) {
+            block.fp_mode.denorm32 == 0) {
       //TODO: we could use fma instead when denormals are enabled if the NIR isn't marked as precise
 
       uint32_t uses_src0 = UINT32_MAX;