From 63a5051ea6bf4d72a02594d21a3351e44bd70da7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 6 Jan 2020 15:27:15 -0500 Subject: [PATCH] ac: set new LLVM denormal flags See: https://reviews.llvm.org/D71358 Acked-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Samuel Pitoiset --- src/amd/llvm/ac_llvm_build.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c index 93e2e281213..dcbd4efeacf 100644 --- a/src/amd/llvm/ac_llvm_build.c +++ b/src/amd/llvm/ac_llvm_build.c @@ -4984,6 +4984,15 @@ ac_build_main(const struct ac_shader_args *args, } ctx->main_function = main_function; + + if (LLVM_VERSION_MAJOR >= 11) { + /* Enable denormals for FP16 and FP64: */ + LLVMAddTargetDependentFunctionAttr(main_function, "denormal-fp-math", + "ieee,ieee"); + /* Disable denormals for FP32: */ + LLVMAddTargetDependentFunctionAttr(main_function, "denormal-fp-math-f32", + "preserve-sign,preserve-sign"); + } return main_function; } -- 2.30.2