summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiang Yu <yuq825@gmail.com>2023-05-15 11:23:06 +0800
committerMarge Bot <emma+marge@anholt.net>2023-05-16 03:29:01 +0000
commit8cc7ad48d5cfac4b2dd7067f0ebee048eceb02d4 (patch)
tree4f71fc021240b097cae54ae231d160375c02d0a0
parentf094c8acfed9d0c9a07c01e5c8b8b96657e30677 (diff)
downloadmesa-8cc7ad48d5cfac4b2dd7067f0ebee048eceb02d4.tar.gz
ac/llvm: remove the double frcp special handling
KHR-GL45.gpu_shader_fp64.builtin.mod_* relaxed precision requirement. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23012>
-rw-r--r--src/amd/llvm/ac_llvm_build.c4
-rw-r--r--src/amd/llvm/ac_nir_to_llvm.c9
2 files changed, 2 insertions, 11 deletions
diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c
index 423cedd04b0..2dd106965ac 100644
--- a/src/amd/llvm/ac_llvm_build.c
+++ b/src/amd/llvm/ac_llvm_build.c
@@ -711,10 +711,6 @@ LLVMValueRef ac_build_fdiv(struct ac_llvm_context *ctx, LLVMValueRef num, LLVMVa
unsigned type_size = ac_get_type_size(LLVMTypeOf(den));
const char *name;
- /* For doubles, we need precise division to pass GLCTS. */
- if (ctx->float_mode == AC_FLOAT_MODE_DEFAULT_OPENGL && type_size == 8)
- return LLVMBuildFDiv(ctx->builder, num, den, "");
-
if (type_size == 2)
name = "llvm.amdgcn.rcp.f16";
else if (type_size == 4)
diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c
index c1b35435d63..3adb8b1d46c 100644
--- a/src/amd/llvm/ac_nir_to_llvm.c
+++ b/src/amd/llvm/ac_nir_to_llvm.c
@@ -671,13 +671,8 @@ static bool visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
src, 2, 0);
break;
case nir_op_frcp:
- /* For doubles, we need precise division to pass GLCTS. */
- if (ctx->ac.float_mode == AC_FLOAT_MODE_DEFAULT_OPENGL && ac_get_type_size(def_type) == 8) {
- result = LLVMBuildFDiv(ctx->ac.builder, ctx->ac.f64_1, ac_to_float(&ctx->ac, src[0]), "");
- } else {
- result = emit_intrin_1f_param_scalar(&ctx->ac, "llvm.amdgcn.rcp",
- ac_to_float_type(&ctx->ac, def_type), src[0]);
- }
+ result = emit_intrin_1f_param_scalar(&ctx->ac, "llvm.amdgcn.rcp",
+ ac_to_float_type(&ctx->ac, def_type), src[0]);
if (ctx->abi->clamp_div_by_zero)
result = ac_build_fmin(&ctx->ac, result,
LLVMConstReal(ac_to_float_type(&ctx->ac, def_type), FLT_MAX));