gallivm: added lp_build_andc()

This commit is contained in:
Brian Paul
2010-03-17 15:07:45 -06:00
parent 8dc8c3f5b1
commit 2b8db4ce15
2 changed files with 15 additions and 0 deletions
@@ -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;
}
@@ -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 */