summaryrefslogtreecommitdiffstats
path: root/src/amd/common/ac_llvm_build.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-02-17 14:26:07 +0100
committerDave Airlie <[email protected]>2017-02-18 06:24:32 +1000
commitedd23e06067b41ba5ced5b60abbe1f6b05ce0b39 (patch)
tree4996ff11ee2bde20770a87f16b50915bc449d410 /src/amd/common/ac_llvm_build.c
parent429f112a1124ace20052f0ea52de691edbfddf03 (diff)
ac/llvm: fix various findMSB bugs
sffbh needs to be suffixed with ".i32" Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/common/ac_llvm_build.c')
-rw-r--r--src/amd/common/ac_llvm_build.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index ed31a5606e8..9751a9329dd 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -769,7 +769,8 @@ ac_emit_imsb(struct ac_llvm_context *ctx,
LLVMValueRef arg,
LLVMTypeRef dst_type)
{
- const char *intr_name = (HAVE_LLVM < 0x0400) ? "llvm.AMDGPU.flbit.i32" : "llvm.amdgcn.sffbh";
+ const char *intr_name = (HAVE_LLVM < 0x0400) ? "llvm.AMDGPU.flbit.i32" :
+ "llvm.amdgcn.sffbh.i32";
LLVMValueRef msb = ac_emit_llvm_intrinsic(ctx, intr_name,
dst_type, &arg, 1,
AC_FUNC_ATTR_READNONE);
@@ -796,7 +797,7 @@ ac_emit_umsb(struct ac_llvm_context *ctx,
{
LLVMValueRef args[2] = {
arg,
- LLVMConstInt(ctx->i32, 1, 0),
+ LLVMConstInt(ctx->i1, 1, 0),
};
LLVMValueRef msb = ac_emit_llvm_intrinsic(ctx, "llvm.ctlz.i32",
dst_type, args, ARRAY_SIZE(args),