aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2020-02-26 15:12:55 +0100
committerSamuel Pitoiset <[email protected]>2020-02-27 08:04:33 +0100
commit9e5d2a73c5fc12841b62758a035b2bdb191b3f86 (patch)
tree79ac95cf9cee6cc693ffc8d779f0dcab61c9c8c1
parent30ac733680c3dfbfd1300c5498dd1b0c0a680905 (diff)
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 <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3962> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3962>
-rw-r--r--src/amd/llvm/ac_llvm_build.c5
1 files changed, 5 insertions, 0 deletions
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;
}