ac/llvm: remove dead code handling for fmod
authorMarek Olšák <marek.olsak@amd.com>
Thu, 23 Jul 2020 02:05:45 +0000 (22:05 -0400)
committerVivek Pandya <vivekvpandya@gmail.com>
Mon, 7 Sep 2020 15:55:16 +0000 (21:25 +0530)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6284>

src/amd/llvm/ac_nir_to_llvm.c

index 735c48884e6992c8e5550a880d9188c4b5571df6..9ad16fba8d340ed49c2f66e0be38964afd45310a 100644 (file)
@@ -701,17 +701,6 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
        case nir_op_umod:
                result = LLVMBuildURem(ctx->ac.builder, src[0], src[1], "");
                break;
-       case nir_op_fmod:
-               /* lower_fmod only lower 16-bit and 32-bit fmod */
-               assert(instr->dest.dest.ssa.bit_size == 64);
-               src[0] = ac_to_float(&ctx->ac, src[0]);
-               src[1] = ac_to_float(&ctx->ac, src[1]);
-               result = ac_build_fdiv(&ctx->ac, src[0], src[1]);
-               result = emit_intrin_1f_param(&ctx->ac, "llvm.floor",
-                                             ac_to_float_type(&ctx->ac, def_type), result);
-               result = LLVMBuildFMul(ctx->ac.builder, src[1] , result, "");
-               result = LLVMBuildFSub(ctx->ac.builder, src[0], result, "");
-               break;
        case nir_op_irem:
                result = LLVMBuildSRem(ctx->ac.builder, src[0], src[1], "");
                break;