ac/llvm: fix amdgcn.fract for v2f16
authorMarek Olšák <marek.olsak@amd.com>
Sat, 4 Jul 2020 20:50:06 +0000 (16:50 -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 337ca6605fc824ca4db697040b001686dba34ec8..857c0f472f833cdfae2e301c27b5787916e00f73 100644 (file)
@@ -860,9 +860,8 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
                                              ac_to_float_type(&ctx->ac, def_type),src[0]);
                break;
        case nir_op_ffract:
-               src[0] = ac_to_float(&ctx->ac, src[0]);
-               result = ac_build_fract(&ctx->ac, src[0],
-                                       instr->dest.dest.ssa.bit_size);
+               result = emit_intrin_1f_param_scalar(&ctx->ac, "llvm.amdgcn.fract",
+                                                    ac_to_float_type(&ctx->ac, def_type), src[0]);
                break;
        case nir_op_fsin:
                result = emit_intrin_1f_param(&ctx->ac, "llvm.sin",