Displaying 3 results from an estimated 3 matches for "classllvm_1_1apint".
2011 Jul 13
2
[LLVMdev] overflow check
Hi,
I have three constants (B, C and V) and V = B + C. I want to find out if B +
C wraps around. The way I'll do it is, assuming B and C are both positive,
to check if V < B or C.
For this I need the values of B, C and V. I tried using APInt as below.
***
If (isa<Constant> (B) && isa<Constant> (C) && isa<Constant>(V)) {
ConstantInt *CV =
2011 Jul 13
0
[LLVMdev] overflow check
...nt &BVal = CB->getValue();
> const APInt &CVal = CC->getValue();
> ******
>
> But isn't APInt considered to represent unsigned integers ? Is there another
> way of doing this ?
APInt's aren't inherently signed or unsigned; see
http://llvm.org/doxygen/classllvm_1_1APInt.html#amgrp54923b9793dae891d9489cc5947f263a
.
-Eli
2011 Sep 06
2
[LLVMdev] bitwise AND
Hi,
I want to compute the bitwise 'and' between two values of type int1: %x = and %a, %b .
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