Mesa (master): ac: set no-signed-zeros-fp-math when RADV_DEBUG="unsafemath" is used

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Tue Jan 16 20:58:51 UTC 2018


Module: Mesa
Branch: master
Commit: 05f73b96721518314729e49b7cadfb2d915a9ff5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=05f73b96721518314729e49b7cadfb2d915a9ff5

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Mon Jan 15 14:51:45 2018 +0100

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 <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 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 635a74d243..5a8ddf13d7 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;
 }




More information about the mesa-commit mailing list