ac/nir: remove unused code for nir_op_{fmod,frem}
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 3 Oct 2019 14:21:47 +0000 (16:21 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 3 Oct 2019 16:15:17 +0000 (18:15 +0200)
RADV and RadeonSI both lower these two NIR instructions.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index ea7bf91b79bc673cf626ee0dfa53091a66ea957d..bb99c736f78e7f9ee909fda34ae40f480681d98b 100644 (file)
@@ -548,20 +548,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:
-               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_frem:
-               src[0] = ac_to_float(&ctx->ac, src[0]);
-               src[1] = ac_to_float(&ctx->ac, src[1]);
-               result = LLVMBuildFRem(ctx->ac.builder, src[0], src[1], "");
-               break;
        case nir_op_irem:
                result = LLVMBuildSRem(ctx->ac.builder, src[0], src[1], "");
                break;