diff options
author | Timothy Arceri <[email protected]> | 2018-02-27 19:37:59 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-02-28 09:23:49 +1100 |
commit | 08fa84bb9adf81aa13422501fef8f077b51ef682 (patch) | |
tree | 6da31020cdc69cd39692b1392eebf281301a55f7 /src/amd/common | |
parent | 9790921ff5c88ad860c55ba21ef1d66afd9ab2dc (diff) |
ac: implement nir_op_ldexp
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index b01012833fe..44d96d27d7f 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -1907,6 +1907,13 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr) result = emit_intrin_3f_param(&ctx->ac, "llvm.fmuladd", ac_to_float_type(&ctx->ac, def_type), src[0], src[1], src[2]); break; + case nir_op_ldexp: + src[0] = ac_to_float(&ctx->ac, src[0]); + if (ac_get_elem_bits(&ctx->ac, LLVMTypeOf(src[0])) == 32) + result = ac_build_intrinsic(&ctx->ac, "llvm.amdgcn.ldexp.f32", ctx->ac.f32, src, 2, AC_FUNC_ATTR_READNONE); + else + result = ac_build_intrinsic(&ctx->ac, "llvm.amdgcn.ldexp.f64", ctx->ac.f64, src, 2, AC_FUNC_ATTR_READNONE); + break; case nir_op_ibitfield_extract: result = emit_bitfield_extract(&ctx->ac, true, src); break; |