gallivm: added lp_build_andc()
authorBrian Paul <brianp@vmware.com>
Wed, 17 Mar 2010 21:07:45 +0000 (15:07 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 17 Mar 2010 22:29:34 +0000 (16:29 -0600)
src/gallium/auxiliary/gallivm/lp_bld_logic.c
src/gallium/auxiliary/gallivm/lp_bld_logic.h

index e2e533f..a3b6970 100644 (file)
@@ -483,3 +483,13 @@ lp_build_alloca(struct lp_build_context *bld)
       return LLVMBuildAlloca(bld->builder, lp_build_elem_type(type), "");
    }
 }
+
+
+/** Return (a & ~b) */
+LLVMValueRef
+lp_build_andc(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b)
+{
+   b = LLVMBuildNot(bld->builder, b, "");
+   b = LLVMBuildAnd(bld->builder, a, b, "");
+   return b;
+}
index d849d29..00a8c75 100644 (file)
@@ -79,4 +79,9 @@ lp_build_select_aos(struct lp_build_context *bld,
 LLVMValueRef
 lp_build_alloca(struct lp_build_context *bld);
 
+
+LLVMValueRef
+lp_build_andc(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b);
+
+
 #endif /* !LP_BLD_LOGIC_H */