[Mesa-dev] [PATCH v2 17/41] ac/nir: implement half-float nir_op_ldexp

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Feb 18 09:09:08 UTC 2019


Patches 14-17 are:

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 2/16/19 1:22 AM, Rhys Perry wrote:
> Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
> ---
>   src/amd/common/ac_nir_to_llvm.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index 8b0e07d2930..0e5946dfdb3 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -829,8 +829,10 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
>   		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)
> +		if (ac_get_elem_bits(&ctx->ac, def_type) == 32)
>   			result = ac_build_intrinsic(&ctx->ac, "llvm.amdgcn.ldexp.f32", ctx->ac.f32, src, 2, AC_FUNC_ATTR_READNONE);
> +		else if (ac_get_elem_bits(&ctx->ac, def_type) == 16)
> +			result = ac_build_intrinsic(&ctx->ac, "llvm.amdgcn.ldexp.f16", ctx->ac.f16, 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;


More information about the mesa-dev mailing list