}
}
+
+/** Return (a & ~b) */
LLVMValueRef
-lp_build_alloca(struct lp_build_context *bld)
+lp_build_andc(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b)
{
- const struct lp_type type = bld->type;
-
- if (type.length > 1) { /*vector*/
- return LLVMBuildAlloca(bld->builder, lp_build_vec_type(type), "");
- } else { /*scalar*/
- return LLVMBuildAlloca(bld->builder, lp_build_elem_type(type), "");
- }
+ b = LLVMBuildNot(bld->builder, b, "");
+ b = LLVMBuildAnd(bld->builder, a, b, "");
+ return b;
}