From 9e5d2a73c5fc12841b62758a035b2bdb191b3f86 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 26 Feb 2020 15:12:55 +0100 Subject: ac/llvm: flush denorms for nir_op_fmed3 on GFX8 and older gens The hardware doesn't flush denorms, exactly like fmin/fmax, so we have to do it manually. This doesn't fix anything known. Fixes: d6a07732c9c ("ac: use llvm.amdgcn.fmed3 intrinsic for nir_op_fmed3") Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Tested-by: Marge Bot Part-of: --- src/amd/llvm/ac_llvm_build.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c index 116abf942c2..2531c5740e0 100644 --- a/src/amd/llvm/ac_llvm_build.c +++ b/src/amd/llvm/ac_llvm_build.c @@ -2759,6 +2759,11 @@ LLVMValueRef ac_build_fmed3(struct ac_llvm_context *ctx, LLVMValueRef src0, AC_FUNC_ATTR_READNONE); } + if (ctx->chip_class < GFX9 && bitsize == 32) { + /* Only pre-GFX9 chips do not flush denorms. */ + result = ac_build_canonicalize(ctx, result, bitsize); + } + return result; } -- cgit v1.2.3