radeonsi: emit LDEXP opcode
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 15 Sep 2017 14:59:09 +0000 (16:59 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 29 Sep 2017 10:08:04 +0000 (12:08 +0200)
The LLVM intrinsic has existed for a long time. The current name was
established in LLVM 3.9.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c

index c82aff23b5ffd2003bd889af3cacd8411c499a8f..9a5b789a2c290d7b9d9b45d02d443ce067030151 100644 (file)
@@ -748,6 +748,7 @@ static int si_get_shader_param(struct pipe_screen* pscreen,
        case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE:
        case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS:
        case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
+       case PIPE_SHADER_CAP_TGSI_LDEXP_SUPPORTED:
                return 1;
 
        case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
@@ -768,7 +769,6 @@ static int si_get_shader_param(struct pipe_screen* pscreen,
        case PIPE_SHADER_CAP_SUBROUTINES:
        case PIPE_SHADER_CAP_SUPPORTED_IRS:
        case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
-       case PIPE_SHADER_CAP_TGSI_LDEXP_SUPPORTED:
                return 0;
        }
        return 0;
index 234fd7f23c3d69f8fd8b88ad505e1ab9698ad0a9..ba7ec4f4107fe5e502dbdfa71b8632117bac6f50 100644 (file)
@@ -800,6 +800,8 @@ void si_shader_context_init_alu(struct lp_build_tgsi_context *bld_base)
        bld_base->op_actions[TGSI_OPCODE_KILL_IF].fetch_args = kill_if_fetch_args;
        bld_base->op_actions[TGSI_OPCODE_KILL_IF].emit = kil_emit;
        bld_base->op_actions[TGSI_OPCODE_KILL].emit = kil_emit;
+       bld_base->op_actions[TGSI_OPCODE_LDEXP].emit = build_tgsi_intrinsic_nomem;
+       bld_base->op_actions[TGSI_OPCODE_LDEXP].intr_name = "llvm.amdgcn.ldexp.f32";
        bld_base->op_actions[TGSI_OPCODE_LSB].emit = emit_lsb;
        bld_base->op_actions[TGSI_OPCODE_LG2].emit = build_tgsi_intrinsic_nomem;
        bld_base->op_actions[TGSI_OPCODE_LG2].intr_name = "llvm.log2.f32";