[Mesa-dev] [PATCH 5/9] radeonsi: add support for FMA

Tom Stellard tom at stellard.net
Thu Mar 5 06:52:22 PST 2015


On Mon, Mar 02, 2015 at 12:54:19PM +0100, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
> 
> ---
>  src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 2 ++
>  src/gallium/drivers/radeonsi/si_pipe.c              | 3 ++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> index 94ef675..8026723 100644
> --- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> +++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> @@ -1314,6 +1314,8 @@ void radeon_llvm_context_init(struct radeon_llvm_context * ctx)
>  	bld_base->op_actions[TGSI_OPCODE_EX2].intr_name = "llvm.AMDIL.exp.";
>  	bld_base->op_actions[TGSI_OPCODE_FLR].emit = build_tgsi_intrinsic_nomem;
>  	bld_base->op_actions[TGSI_OPCODE_FLR].intr_name = "floor";
> +	bld_base->op_actions[TGSI_OPCODE_FMA].emit = build_tgsi_intrinsic_nomem;
> +	bld_base->op_actions[TGSI_OPCODE_FMA].intr_name = "llvm.fma.f32";
>  	bld_base->op_actions[TGSI_OPCODE_FRC].emit = build_tgsi_intrinsic_nomem;
>  	bld_base->op_actions[TGSI_OPCODE_FRC].intr_name = "llvm.AMDIL.fraction.";
>  	bld_base->op_actions[TGSI_OPCODE_F2I].emit = emit_f2i;
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
> index 0aacab1..87eeac6 100644
> --- a/src/gallium/drivers/radeonsi/si_pipe.c
> +++ b/src/gallium/drivers/radeonsi/si_pipe.c
> @@ -425,8 +425,9 @@ static int si_get_shader_param(struct pipe_screen* pscreen, unsigned shader, enu
>  	case PIPE_SHADER_CAP_DOUBLES:
>  	case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
>  	case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
> -	case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED:
>  		return 0;
> +	case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED:
> +		return 1;
>  	}
>  	return 0;
>  }
> -- 
> 2.1.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list