From 05f73b96721518314729e49b7cadfb2d915a9ff5 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 15 Jan 2018 14:51:45 +0100 Subject: [PATCH] ac: set no-signed-zeros-fp-math when RADV_DEBUG="unsafemath" is used 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 Reviewed-by: Bas Nieuwenhuizen --- src/amd/common/ac_nir_to_llvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 635a74d..5a8ddf1 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -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; } -- 2.7.4