[LLVMdev] bitwise AND
baldrick at free.fr
Tue Sep 6 03:04:38 PDT 2011
> I want to compute the bitwise 'and' between two values of type int1: %x = and
> %a, %b .
That said, use an IRBuilder which has lots of convenience methods
(like CreateAnd) to help with creating IR.
> Which is the LLVM instruction that creates this? I only found the APInt class,
> whose constructor is:
> APInt(unsigned numBits, uint64_t val, bool isSigned = false)
> and which provides the bitwise AND operation:
> APInt llvm::APIntOps::And
> (const APInt &LHS, const APInt &RHS)
> Bitwise AND function for APInt
> Is this the best way to build the 'and' instruction that I need? If so, how can
> I send the value uint64_t stored in the values %a , %b of type int1 ?
> Thank you.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev