mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-28 15:00:43 +01:00
ac/llvm: Use new denormal_fpenv attribute for llvm >= 23
Reviwed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39566>
This commit is contained in:
parent
ec9df376d8
commit
c431eaad63
1 changed files with 14 additions and 3 deletions
|
|
@ -3641,11 +3641,22 @@ struct ac_llvm_pointer ac_build_main(const struct ac_shader_args *args, struct a
|
|||
.pointee_type = main_function_type
|
||||
};
|
||||
|
||||
/* Enable denormals for FP16 and FP64: */
|
||||
LLVMAddTargetDependentFunctionAttr(main_function, "denormal-fp-math", "ieee,ieee");
|
||||
/* Disable denormals for FP32: */
|
||||
/* Enable denormals for FP16 and FP64, disable denormals for FP32 */
|
||||
#if LLVM_VERSION_MAJOR >= 23
|
||||
LLVMAttributeRef fpenv_attr = LLVMCreateDenormalFPEnvAttribute(ctx,
|
||||
LLVMDenormalModeKindIEEE,
|
||||
LLVMDenormalModeKindIEEE,
|
||||
LLVMDenormalModeKindPreserveSign,
|
||||
LLVMDenormalModeKindPreserveSign);
|
||||
|
||||
LLVMAddAttributeAtIndex(main_function, LLVMAttributeFunctionIndex,
|
||||
fpenv_attr);
|
||||
#else
|
||||
LLVMAddTargetDependentFunctionAttr(main_function, "denormal-fp-math",
|
||||
"ieee,ieee");
|
||||
LLVMAddTargetDependentFunctionAttr(main_function, "denormal-fp-math-f32",
|
||||
"preserve-sign,preserve-sign");
|
||||
#endif
|
||||
|
||||
if (convention == AC_LLVM_AMDGPU_PS) {
|
||||
LLVMAddTargetDependentFunctionAttr(main_function, "amdgpu-depth-export",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue