gallivm: added lp_sizeof_llvm_type()
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_logic.c
index e2e533fa7ec7a50a393fec329091f92f8cabef92..d13fa1a5d043b4f5cf9c9f8e23a477647fe534bd 100644 (file)
@@ -472,14 +472,12 @@ lp_build_select_aos(struct lp_build_context *bld,
    }
 }
 
+
+/** 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;
 }