From: Marek Olšák Date: Mon, 6 Jan 2020 20:27:15 +0000 (-0500) Subject: ac: set new LLVM denormal flags X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=63a5051ea6bf4d72a02594d21a3351e44bd70da7;p=mesa.git ac: set new LLVM denormal flags See: https://reviews.llvm.org/D71358 Acked-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Samuel Pitoiset --- 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; }