diff options
author | Marek Olšák <[email protected]> | 2020-01-06 15:27:15 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-17 20:47:48 +0000 |
commit | 63a5051ea6bf4d72a02594d21a3351e44bd70da7 (patch) | |
tree | 3ed8c67de03df68b4657b950e20b7f1e4b6e8ea5 /src/amd | |
parent | 56cc10bd27b24d513de88bf7fa94a6c8f43e348f (diff) |
ac: set new LLVM denormal flags
See: https://reviews.llvm.org/D71358
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4196>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/llvm/ac_llvm_build.c | 9 |
1 files changed, 9 insertions, 0 deletions
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; } |