|
|
|
@@ -252,3 +252,17 @@ lp_build_popcount(struct lp_build_context *bld, LLVMValueRef a) |
|
|
|
result = lp_build_intrinsic_unary(builder, intr_str, bld->vec_type, a); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
LLVMValueRef |
|
|
|
lp_build_cttz(struct lp_build_context *bld, LLVMValueRef a) |
|
|
|
{ |
|
|
|
LLVMBuilderRef builder = bld->gallivm->builder; |
|
|
|
LLVMValueRef result; |
|
|
|
char intr_str[256]; |
|
|
|
|
|
|
|
lp_format_intrinsic(intr_str, sizeof(intr_str), "llvm.cttz", bld->vec_type); |
|
|
|
|
|
|
|
LLVMValueRef undef_val = LLVMConstNull(LLVMInt1TypeInContext(bld->gallivm->context)); |
|
|
|
result = lp_build_intrinsic_binary(builder, intr_str, bld->vec_type, a, undef_val); |
|
|
|
return result; |
|
|
|
} |