diff options
author | Rhys Perry <[email protected]> | 2018-12-06 14:35:23 +0000 |
---|---|---|
committer | Rhys Perry <[email protected]> | 2019-02-19 11:04:41 +0000 |
commit | 6971e8d34287d5cde43cadd4f9c3b0af0907e1a3 (patch) | |
tree | 25353148188b17141d99c92ee2891c753bf6bcaf /src/amd/common | |
parent | 2038aec22ad4063bb3d7f213e1bfab9b944813d8 (diff) |
ac/nir: implement half-float nir_op_frsq
v2: don't use ac_get_onef()
Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd/common')
-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 8a4346ebc14..a76687930d8 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -788,8 +788,7 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr) case nir_op_frsq: result = emit_intrin_1f_param(&ctx->ac, "llvm.sqrt", ac_to_float_type(&ctx->ac, def_type), src[0]); - result = ac_build_fdiv(&ctx->ac, instr->dest.dest.ssa.bit_size == 32 ? ctx->ac.f32_1 : ctx->ac.f64_1, - result); + result = ac_build_fdiv(&ctx->ac, LLVMConstReal(LLVMTypeOf(result), 1.0), result); break; case nir_op_frexp_exp: src[0] = ac_to_float(&ctx->ac, src[0]); |