search for: lhs

Displaying 20 results from an estimated 733 matches for "lhs".

Did you mean: lds
2012 May 21
0
[LLVMdev] APInt::sdivrem error?
OK, the code for sdivrem in APInt.h is wrong. Here's what's written: static void sdivrem(const APInt &LHS, const APInt &RHS, APInt &Quotient, APInt &Remainder) { if (LHS.isNegative()) { if (RHS.isNegative()) APInt::udivrem(-LHS, -RHS, Quotient, Remainder); else APInt::udivrem(-LHS, RHS, Quotient, Remainder); Quotient = -Quotient; Rem...
2011 Sep 22
2
[LLVMdev] Need help in converting int to double
..., sarath chandra <sarathcse19 at gmail.com>wrote: > Hi James, > > First i converted the void * to int* and then did FPToSI...then did SHL...( > because CreateShl only accepts integers... i pointer casted it to int64 type > first)... Below is the code snippet.... > > > lhs = mBuilder.CreateStructGEP(firstArg, 0); > lhs = mBuilder.CreateLoad(lhs); > lhs = mBuilder.CreatePointerCast(lhs, PointerType::get( > mBuilder.getInt64Ty(), 0)); > int typelhs = getValueType(lhs); > rhs = mBuilder.CreateStructGEP(secondArg, 0); > r...
2012 May 21
3
[LLVMdev] APInt::sdivrem error?
I wrote the following bit of code static APInt FloorOfQuotient(APInt a, APInt b) { unsigned bits = a.getBitWidth(); APInt q(bits, 1), r(bits, 1); APInt::sdivrem(a, b, q, r); * errs() << "sdivrem(" << a << ", " << b << ") = (" << q << ", " << r << ")\n"; * if (r == 0) return q; else {
2016 Sep 14
2
undef * 0
Hi, > Both A and B are undef: > LHS = (undef & undef) | (undef & undef) = undef // Since ~undef = undef > RHS = undef > Thus transform is correct. LLVM documentation (http://llvm.org/docs/LangRef.html#undefined-values) suggests that it is unsafe to consider (a & undef = undef) and (a | undef = undef)....
2011 Sep 13
3
[LLVMdev] Setting priority in instruction selection
...agment that uses an immediate value to be selected before the immediate instruction itself. So, my question is this, is there anyway to force the ordering of how the instructions get selected. For example, take this pattern (A & B) | (C & ~B), I have the following PatFrag: /// Pattern 1: (lhs & bitpat) | (rhs & ~bitpat) def bfi_pat1 : PatFrag<(ops node:$lhs, node:$rhs, node:$bitpat), (or (and node:$lhs, node:$bitpat), (and node:$rhs, (not node:$lhs)))>; def BFI_i32 : ThreeInOneOut<IL_OP_BFI, (outs GPRI32:$dst), (ins GPRI32:$lhs, GPRI32:$rhs, GPRI32:$bi...
2011 Sep 22
3
[LLVMdev] Need help in converting int to double
...k-end". Now i'm writing code for shift left(SHL) operator. I had my own Value Structure .. it's like this Struct Value { void *val ; char type; } The "char type" holds DoubleType,DoubleConst,StringType,StringConst... when i'm executing the IrBuilder.CreateShl(LHS,RHS) instruction it is returning an integer value as output.. i'm unable to store the value in my structure....(because my structure can hold Doubles,Strings). Is there any way to store the integer output in my structure( i used CreateSIToFP() to change int to double)........ Thanks in adva...
2011 Sep 22
0
[LLVMdev] Need help in converting int to double
...sarath chandra <sarathcse19 at gmail.com<mailto:sarathcse19 at gmail.com>> wrote: Hi James, First i converted the void * to int* and then did FPToSI...then did SHL...( because CreateShl only accepts integers... i pointer casted it to int64 type first)... Below is the code snippet.... lhs = mBuilder.CreateStructGEP(firstArg, 0); lhs = mBuilder.CreateLoad(lhs); lhs = mBuilder.CreatePointerCast(lhs, PointerType::get( mBuilder.getInt64Ty(), 0)); int typelhs = getValueType(lhs); rhs = mBuilder.CreateStructGEP(secondArg, 0); rhs = mBuilder.CreateLoad(rhs);...
2011 Sep 22
1
[LLVMdev] Need help in converting int to double
...ra <sarathcse19 at gmail.com> > wrote:**** > > Hi James, > > First i converted the void * to int* and then did FPToSI...then did SHL...( > because CreateShl only accepts integers... i pointer casted it to int64 type > first)... Below is the code snippet.... > > > lhs = mBuilder.CreateStructGEP(firstArg, 0); > lhs = mBuilder.CreateLoad(lhs); > lhs = mBuilder.CreatePointerCast(lhs, PointerType::get( > mBuilder.getInt64Ty(), 0)); > int typelhs = getValueType(lhs); > rhs = mBuilder.CreateStructGEP(secondArg, 0); > r...
2011 Sep 13
1
[LLVMdev] Setting priority in instruction selection
...gt; So, my question is this, is there anyway to force the ordering of how > the > > instructions get selected. > > > > > > > > For example, take this pattern (A & B) | (C & ~B), I have the > following > > PatFrag: > > > > /// Pattern 1: (lhs & bitpat) | (rhs & ~bitpat) > > > > def bfi_pat1 : PatFrag<(ops node:$lhs, node:$rhs, node:$bitpat), > > > >     (or > > > >      (and node:$lhs, node:$bitpat), > > > >      (and node:$rhs, (not node:$lhs)))>; > > > > def BFI...
2007 Nov 21
3
[LLVMdev] Add/sub with carry; widening multiply
I've been playing around with llvm lately and I was wondering something about the bitcode instructions for basic arithmetic. Is there any plan to provide instructions that perform widening multiply, or add with carry? It might be written as: mulw i32 %lhs %rhs -> i64 ; widening multiply addw i32 %lhs %rhs -> i33 ; widening add addc i32 %lhs, i32 %rhs, i1 %c -> i33 ; add with carry Alternatively, would something like following get reduced to a single multiply and two stores on arch's that support wide multiplies, like x86-32 and ARM? d...
2011 Sep 13
0
[LLVMdev] Setting priority in instruction selection
...gt; immediate instruction itself. > > > > So, my question is this, is there anyway to force the ordering of how the > instructions get selected. > > > > For example, take this pattern (A & B) | (C & ~B), I have the following > PatFrag: > > /// Pattern 1: (lhs & bitpat) | (rhs & ~bitpat) > > def bfi_pat1 : PatFrag<(ops node:$lhs, node:$rhs, node:$bitpat), > >     (or > >      (and node:$lhs, node:$bitpat), > >      (and node:$rhs, (not node:$lhs)))>; > > def BFI_i32 : ThreeInOneOut<IL_OP_BFI, (outs GPRI32:$d...
2016 Sep 13
2
undef * 0
Thanks for your answers. Another example of unsound transformation on Boolean algebra. According to the LLVM documentation (http://llvm.org/docs/LangRef.html#undefined-values) it is unsafe to consider ' a & undef = undef ' and ' a | undef = undef ' but 'undef xor undef = undef' is safe. Now, given an expression ((a & (~b)) | ((~a) & b)) where a and b are
2007 Aug 14
1
[LLVMdev] Static functions for APInt
...+ /// parts were zero return zero, otherwise overflow occurred and + /// return one. + static int tcMultiplyPart(integerPart *dst, const integerPart *src, + integerPart multiplier, integerPart carry, + unsigned int srcParts, unsigned int dstParts, + bool add); + + /// DST = LHS * RHS, where DST has the same width as the operands + /// and is filled with the least significant parts of the result. + /// Returns one if overflow occurred, otherwise zero. DST must be + /// disjoint from both operands. + static int tcMultiply(integerPart *, const integerPart *, + const i...
2012 Oct 19
2
[LLVMdev] interesting minor llvm optimizer flaw
...the boundary condition where k==-32768 Then it creates the literal -32769 which cannot be placed in a simple immediate field. That creates a lot of extra code for Mips 16. I had originally written a pattern for setge when the right operand is a constant. def: Mips16Pat <(setge CPU16Regs:$lhs, immZExt16:$rhs), (XorRxRxRy16 (SltiCCRxImmX16 CPU16Regs:$lhs, immZExt16:$rhs), (LiRxImmX16 1))>; I was able to work around this boundary case by doing the reverse transformation at the boundary. i..e. z = (x > (k-1)) => z = (x >= k) def: Mips16Pat <(setgt CPU16Regs:...
2017 May 27
2
Latin Hypercube Sampling when parameters are defined according to specific probability distributions
>May 26, 2017; 11:41am Nelly Reduan Latin Hypercube Sampling when parameters are >defined according to specific probability distributions >Hello, > I would like to perform a sensitivity analysis using a Latin Hypercube Sampling (LHS). >Among the input parameters in the model, I have a parameter dispersal distance which is defined according to an exponential probability distribution. >In the model, the user thus sets a default probability value for each distance class. >For example, for distances ([0 2]; ]2 4]; ]4...
2008 Dec 09
1
[LLVMdev] [PATH] Add sub.ovf/mul.ovf intrinsics
Hi, The attached patch implements sub.ovf/mul.ovf intrinsics similarly to the recently added add.ovf intrinsics. These are useful for implementing some vm instructions like sub.ovf/mul.ovf in .NET IL efficiently. sub.ovf is supported in target independent lowering and on x86, while mul.ovf is only supported in the x86 backend. Please review
2019 Apr 29
2
How does Twine work?
I'm looking at the documentation on Twine at http://llvm.org/docs/ProgrammersManual.html#llvm-adt-twine-h and it gives example code: void foo(const Twine &T); ... StringRef X = ... unsigned i = ... foo(X + "." + Twine(i)); How exactly does that last line work? Since addition is left associative, I would expect it to be parsed as (X + ".") ... so it's trying to add
2017 Jun 01
1
Latin Hypercube Sampling when parameters are defined according to specific probability distributions
Thank you very much Rob for your answer. I have some difficulties to understand how to apply my agent-based model to each parameter combination generated by the LHS, in particular when parameters are defined by probability distributions. Indeed, I have multiple parameters in my model: parameters which are defined by a single value (like ?temperature", "pressure?) and parameters which are defined by probability distributions (like ?dispersal distance?...
2013 Jul 22
0
[LLVMdev] Analysis of polly-detect overhead in oggenc
..."Non branch instruction terminates BB: " + BB.getName().str(); >> >> >> Second, it simplifies some complex operations like: >> INVALID(AffFunc, >> "Non affine branch in BB '" << BB.getName() << "' with LHS: " >> << *LHS << " and RHS: " << *RHS); >> into: >> LastFailure = "Non affine branch in BB: " + BB.getName().str(); > > >> In such cases, some information for "LHS" a...
2009 Jun 26
0
[LLVMdev] bitwise AND selector node not commutative?
On Jun 25, 2009, at 4:38 PM, David Goodwin wrote: > Using the Thumb-2 target we see that ORN ( a | ^b) and BIC (a & ^b) > have similar patterns, as we would expect: > > defm t2BIC : T2I_bin_irs<"bic", BinOpFrag<(and node:$LHS, (not node: > $RHS))>>; > defm t2ORN : T2I_bin_irs<"orn", BinOpFrag<(or node:$LHS, (not node: > $RHS))>>; > > Compiling the following three works as expected: > > %tmp1 = xor i32 4294967295, %b ; %tmp2 = or i32 %a, %tmp1 -- > > or...