ac: set no-signed-zeros-fp-math when RADV_DEBUG="unsafemath" is used
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 15 Jan 2018 13:51:45 +0000 (14:51 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 16 Jan 2018 20:39:57 +0000 (21:39 +0100)
This is an optimisation that is recommended by Matt Arsenault,
and used by RadeonSI, but it's not compatible with Vulkan.

Note that AC_FLOAT_MODE_UNSAFE_FP_MATH includes the no signed
zeros flag in LLVM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index 635a74d243055cbda9d5e2812b4003055a20738b..5a8ddf13d7b653d749d0a01ff5d22e2240e12bd5 100644 (file)
@@ -352,6 +352,9 @@ create_llvm_function(LLVMContextRef ctx, LLVMModuleRef module,
                LLVMAddTargetDependentFunctionAttr(main_function,
                                                   "unsafe-fp-math",
                                                   "true");
+               LLVMAddTargetDependentFunctionAttr(main_function,
+                                          "no-signed-zeros-fp-math",
+                                          "true");
        }
        return main_function;
 }