diff options
author | Rhys Perry <[email protected]> | 2018-12-06 14:33:21 +0000 |
---|---|---|
committer | Rhys Perry <[email protected]> | 2019-02-19 11:04:35 +0000 |
commit | 2038aec22ad4063bb3d7f213e1bfab9b944813d8 (patch) | |
tree | 478924c84f24e15b831208d3c7c27b4bd01647f2 | |
parent | 4261edc067949b1b75b1fbdb05353e1dc9967be6 (diff) |
ac/nir: implement half-float nir_op_frcp
v2: don't use ac_get_onef()
Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 336346f6040..8a4346ebc14 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], ""); |