[Mesa-dev] [PATCH] radv: set no-signed-zeros-fp-math

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Jan 10 21:31:19 UTC 2018


This is an optimisation that is recommended by Matt Arsenault,
and used by RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/common/ac_nir_to_llvm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 1520342d05..b474c29244 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -338,6 +338,11 @@ create_llvm_function(LLVMContextRef ctx, LLVMModuleRef module,
 						     "amdgpu-max-work-group-size",
 						     max_workgroup_size);
 	}
+
+	LLVMAddTargetDependentFunctionAttr(main_function,
+					   "no-signed-zeros-fp-math",
+					   "true");
+
 	if (unsafe_math) {
 		/* These were copied from some LLVM test. */
 		LLVMAddTargetDependentFunctionAttr(main_function,
-- 
2.15.1



More information about the mesa-dev mailing list