radeon/ac: use llvm.amdgcn.sffbh intrinsic instead of AMDGPU.flbit.i32
authorDave Airlie <airlied@redhat.com>
Thu, 16 Feb 2017 03:46:16 +0000 (03:46 +0000)
committerDave Airlie <airlied@redhat.com>
Thu, 16 Feb 2017 22:57:16 +0000 (22:57 +0000)
Use the newer intrinsic.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_llvm_build.c

index 180fd2414a5c713590b2410a03145e862d094d50..dda2c0b94216766b6befd7ba50e8ba599d54f3cf 100644 (file)
@@ -769,7 +769,8 @@ ac_emit_imsb(struct ac_llvm_context *ctx,
             LLVMValueRef arg,
             LLVMTypeRef dst_type)
 {
-       LLVMValueRef msb = ac_emit_llvm_intrinsic(ctx, "llvm.AMDGPU.flbit.i32",
+       const char *intr_name = (HAVE_LLVM < 0x0400) ? "llvm.AMDGPU.flbit.i32" : "llvm.amdgcn.sffbh";
+       LLVMValueRef msb = ac_emit_llvm_intrinsic(ctx, intr_name,
                                                  dst_type, &arg, 1,
                                                  AC_FUNC_ATTR_READNONE);