search for: createneg

Displaying 7 results from an estimated 7 matches for "createneg".

2015 Apr 11
2
[LLVMdev] How doesn't llvm generate IR for logical negate operation
How can I generate LLVM IR for both logical NEG (!)? For example, if I have Int32Ty a, For the bitwise NEG(~): c = ~a ; I can use the following API from LLVM: BinaryOperator *neg = BinaryOperator::CreateNeg(nbits, "bitwiseNEG", insertBefore); How, if I want to generate logical NEG: c = !a; what should I do for this? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150410/1656e4c7/attachment.h...
2015 Apr 11
2
[LLVMdev] How doesn't llvm generate IR for logical negate operation
...wrote: > >> How can I generate LLVM IR for both logical NEG (!)? For example, if I >> have Int32Ty a, >> >> For the bitwise NEG(~): >> >> c = ~a ; >> >> I can use the following API from LLVM: >> >> BinaryOperator *neg = BinaryOperator::CreateNeg(nbits, "bitwiseNEG", insertBefore); >> >> How, if I want to generate logical NEG: >> >> c = !a; >> >> what should I do for this? >> >> Thanks >> >> _______________________________________________ >> LLVM Developers mailing...
2011 Nov 03
1
[LLVMdev] Why there is no unary operator in LLVM?
...ch as Neg or Or operator, the IR builder just creates a binary operation with one dummy operand, 01823 <http://llvm.org/doxygen/classllvm_1_1BinaryOperator.html#a073c092ce74a122e898e435e60e84599> BinaryOperator <http://llvm.org/doxygen/classllvm_1_1BinaryOperator.html> *BinaryOperator::CreateNeg <http://llvm.org/doxygen/classllvm_1_1BinaryOperator.html#a073c092ce74a122e898e435e60e84599>(Value <http://llvm.org/doxygen/classllvm_1_1Value.html> *Op, const Twine <http://llvm.org/doxygen/classllvm_1_1Twine.html> &Name,01824 BasicBlock <h...
2015 Apr 11
2
[LLVMdev] How doesn't llvm generate IR for logical negate operation
...)? For example, if I >>>> have Int32Ty a, >>>> >>>> For the bitwise NEG(~): >>>> >>>> c = ~a ; >>>> >>>> I can use the following API from LLVM: >>>> >>>> BinaryOperator *neg = BinaryOperator::CreateNeg(nbits, "bitwiseNEG", insertBefore); >>>> >>>> How, if I want to generate logical NEG: >>>> >>>> c = !a; >>>> >>>> what should I do for this? >>>> >>>> Thanks >>>> >>>> _...
2015 Apr 11
2
[LLVMdev] How doesn't llvm generate IR for logical negate operation
...t;>>> >>>>>> For the bitwise NEG(~): >>>>>> >>>>>> c = ~a ; >>>>>> >>>>>> I can use the following API from LLVM: >>>>>> >>>>>> BinaryOperator *neg = BinaryOperator::CreateNeg(nbits, "bitwiseNEG", insertBefore); >>>>>> >>>>>> How, if I want to generate logical NEG: >>>>>> >>>>>> c = !a; >>>>>> >>>>>> what should I do for this? >>>>>> &gt...
2016 Apr 24
2
Retrieving numeric value of instruction operand
...atever>; > Value * Va = i->getOperand(0); > > The variable Va points to the object representing the first operand of the > instruction (in your case, %a). You can then create new instructions that > use this value as an operand: > > BinaryOperator * Sub = BinaryOperator::CreateNeg (Va, "name", InsertPt); > > The above would create the following instruction (which is an integer > negation instruction): > > %name = sub 0, %a > > Regards, > > John Criswell > > > On Apr 24, 2016 7:18 AM, "John Criswell" <jtcriswel at gma...
2016 Apr 24
2
Retrieving numeric value of instruction operand
hey john, yes indeed, that's what I'm trying, retreiving the values of %a and %b in an LLVM pass, sorry about the confusion. On Apr 24, 2016 7:18 AM, "John Criswell" <jtcriswel at gmail.com> wrote: > Dear Ammar, > > It is not clear what you are asking. %a and %b in your code below are not > constants; there is no way, at compile time, to determine what