From: Rhys Perry Date: Thu, 6 Dec 2018 14:33:21 +0000 (+0000) Subject: ac/nir: implement half-float nir_op_frcp X-Git-Tag: upstream/19.3.0~9682 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2038aec22ad4063bb3d7f213e1bfab9b944813d8;p=platform%2Fupstream%2Fmesa.git ac/nir: implement half-float nir_op_frcp v2: don't use ac_get_onef() Signed-off-by: Rhys Perry Reviewed-by: Samuel Pitoiset --- diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 336346f..8a4346e 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -657,8 +657,7 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr) break; case nir_op_frcp: src[0] = ac_to_float(&ctx->ac, src[0]); - result = ac_build_fdiv(&ctx->ac, instr->dest.dest.ssa.bit_size == 32 ? ctx->ac.f32_1 : ctx->ac.f64_1, - src[0]); + result = ac_build_fdiv(&ctx->ac, LLVMConstReal(LLVMTypeOf(src[0]), 1.0), src[0]); break; case nir_op_iand: result = LLVMBuildAnd(ctx->ac.builder, src[0], src[1], "");