radeonsi: add support for FMA
authorMarek Olšák <marek.olsak@amd.com>
Fri, 27 Feb 2015 23:44:19 +0000 (00:44 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 16 Mar 2015 11:54:18 +0000 (12:54 +0100)
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
src/gallium/drivers/radeonsi/si_pipe.c

index 94ef675806681da0e13ca6a2c7e5cb1b5792df2b..80267233959cce350cd029217098c03ae83dd46d 100644 (file)
@@ -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;
index 0aacab12db7a14ca32e14782ead6ba670ed03486..87eeac6fbe8c89def8c65ccdb90444b99cd126e2 100644 (file)
@@ -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;
 }