radeonsi: use llvm.amdgcn.rsq.f64 if available
authorMarek Olšák <marek.olsak@amd.com>
Sat, 30 Jul 2016 14:23:48 +0000 (16:23 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 3 Aug 2016 15:46:46 +0000 (17:46 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c

index 4c603fb1aadef27e6ea644afb7510e5f80402ca6..cd9ac268eedc253ec5634629a12b38650021531b 100644 (file)
@@ -1758,7 +1758,8 @@ void radeon_llvm_context_init(struct radeon_llvm_context *ctx, const char *tripl
        bld_base->op_actions[TGSI_OPCODE_DSLT].emit = emit_dcmp;
        bld_base->op_actions[TGSI_OPCODE_DSNE].emit = emit_dcmp;
        bld_base->op_actions[TGSI_OPCODE_DRSQ].emit = build_tgsi_intrinsic_nomem;
-       bld_base->op_actions[TGSI_OPCODE_DRSQ].intr_name = "llvm.AMDGPU.rsq.f64";
+       bld_base->op_actions[TGSI_OPCODE_DRSQ].intr_name =
+               HAVE_LLVM >= 0x0309 ? "llvm.amdgcn.rsq.f64" : "llvm.AMDGPU.rsq.f64";
        bld_base->op_actions[TGSI_OPCODE_DSQRT].emit = build_tgsi_intrinsic_nomem;
        bld_base->op_actions[TGSI_OPCODE_DSQRT].intr_name = "llvm.sqrt.f64";
        bld_base->op_actions[TGSI_OPCODE_ELSE].emit = else_emit;