diff options
author | Brian Paul <brianp@vmware.com> | 2010-03-17 15:07:45 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-03-17 16:29:34 -0600 |
commit | 2b8db4ce156fbd4d094f46fad0b8b3291b057fff (patch) | |
tree | 77621e414a526b29be3a5c8f8f764d728beaa761 | |
parent | 8dc8c3f5b11d5f158b0027d1501555c898e0451e (diff) |
gallivm: added lp_build_andc()
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_logic.c | 10 | ||||
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_logic.h | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.c b/src/gallium/auxiliary/gallivm/lp_bld_logic.c index e2e533fa7e..a3b6970116 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_logic.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.c @@ -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; +} diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.h b/src/gallium/auxiliary/gallivm/lp_bld_logic.h index d849d29e95..00a8c75019 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_logic.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.h @@ -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 */ |