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 e2e533fa7ec7a50a393fec329091f92f8cabef92..a3b697011626daba23662bd98a41f695d6ce3c17 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 d849d29e95d15004f83fff99e6ab94086b3f7c17..00a8c750196d0a62c246fb16ab32acbba3a49f67 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 */