search for: modulo

Displaying 20 results from an estimated 873 matches for "modulo".

Did you mean: module
2016 Oct 21
2
Problem with REMAINDER? 957%60 be 15 remainder 57 not 15 remainder -3 ?
I'm not mathematically gifted, but shouldn't 957%60 be 15 remainder 57? Google and my desktop calculator certainly think so. So where am I going wrong here? The following code exten => 7,1,Verbose(Context: ${CONTEXT} Exten:${EXTEN}) same => n,Set(myNum=957) same => n,Set(sec=$[REMAINDER(${myNum},60)]) same => n,Set(sec=$[ABS(${sec})]) same =>
2014 Nov 10
2
[LLVMdev] About inlining the modulo function in ARM architecture
Hi all, Sorry for bothering those not interested. I found that ARM backend will insert a modulo function (like __modsi3) instead of the modulo instruction. I wonder how we can inline the modulo function into the program. Is there any OPTION we can use in the opt or llc? Thanks, Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/piper...
2018 Jul 02
2
Rotates, once again
...ift_amount) > declare <2 x i32> @llvm.catshift.v2i32(<2 x i32> %a, <2 x i32> %b, <2 x i32> %shift_amount) > > For scalars, @llvm.catshift concatenates %a and %b, shifts the > concatenated value right by the number of bits specified by > %shift_amount modulo the bit-width, and truncates to the original > bit-width. > For vectors, that operation occurs for each element of the vector: >    result[i] = trunc(concat(a[i], b[i]) >> c[i]) > If %a == %b, this is equivalent to a bitwise rotate right. Rotate left > may be implemented by...
2011 Jan 25
1
deSolve: Problem solving ODE including modulo-operator
I have a problem integrating the 'standard map' ( http://en.wikipedia.org/wiki/Standard_map http://en.wikipedia.org/wiki/Standard_map ) with deSolve: By using the modulo-operator '%%' with 2*pi in the ODEs (standardmap1), the resulting values of P and Theta, should not be greater than 2pi. Because this was not the case, i was thinking that the function 'ode' has some internal problems with the '%%' or integrating periodical ODEs, so I wrote...
2013 Jan 23
2
[LLVMdev] Order of optimization: modulo scheduling & register allocation
...eresting to me: 3. SSA-based Machine Code Optimizations<http://llvm.org/docs/CodeGenerator.html#ssa-based-machine-code-optimizations>— This optional stage consists of a series of machine-code optimizations that operate on the SSA-form produced by the instruction selector. Optimizations like* modulo-scheduling* or peephole optimization work here. 4. Register Allocation<http://llvm.org/docs/CodeGenerator.html#register-allocation>— The target code is transformed from an infinite virtual register file in SSA form to the concrete register file used by the target. This phase*introduces spill...
2013 Jan 24
0
[LLVMdev] Order of optimization: modulo scheduling & register allocation
...el-design-of-the-code-generator > > This is the part that's interesting to me: > > 3. SSA-based Machine Code Optimizations — This optional stage consists of a series of machine-code optimizations that operate on the SSA-form produced by the instruction selector. Optimizations like modulo-scheduling or peephole optimization work here. > 4. Register Allocation — The target code is transformed from an infinite virtual register file in SSA form to the concrete register file used by the target. This phase introduces spill code and eliminates all virtual register references from the p...
2004 Feb 29
1
LCG with modulo 2^30
I can't run a function which generates random numbrers using linear congruential generator. My multiplier is a=5+8^6, increment is b=1 and modulo is m=2^30. the code I have written works for modulo upto m=2^28. For m= 2^29 , it says, can not allocate memory for the vector or something like that. For m= 2^31 or more, its says the argument "for i in 1:m " is too large in magnitude. I tried to increase the memory size but it d...
2017 Jun 26
2
Some questions about software pipeline in LLVM 4.0.0
Hi Ehsan, In some cases modulo scheduling will insert copy instruction that end up as real copies in the final code. It unavoidable in some cases. For example, let's say a instruction defining a value is scheduled in the first iteration, but one of its uses is scheduled two iterations later. In this case, the kernel needs...
2018 Sep 11
2
Modification-proposal for %% (modulo) when supplied with double
Hi all, Could we modify the "%%" (modulo)-operator to include some tolerance for rounding-errors when supplied with doubles? It's not much work (patch supplied on the bottom), and I don't think it would break anything, only if you were really interested in analysing rounding differences. Any ideas about implementing this and ove...
2018 Sep 11
0
Modification-proposal for %% (modulo) when supplied with double
On 11/09/2018 11:23 AM, Emil Bode wrote: > Hi all, > > > > Could we modify the "%%" (modulo)-operator to include some tolerance for rounding-errors when supplied with doubles? > > It's not much work (patch supplied on the bottom), and I don't think it would break anything, only if you were really interested in analysing rounding differences. > > Any ideas about imple...
2013 Nov 14
1
Re: make_random_password(): avoid modulo bias, and do not deplete system entropy (#9)
...ommits from this pull request. > > 1. Using Ocaml&#39;s buffered I/O means that one make_random_password() call reads 64k bytes from /dev/urandom which drops the system&#39;s entropy to minimum ~128 bits. The fix is to use unbuffered I/O from the Unix module. > > 2. There is a modulo bias when generating the random password: [0,256) mod 60 won&#39;t give you uniformly distributed bytes. In this particular case it probably doesn&#39;t matter, but you never know when someone copy+pastes your code into their project thinking this is a proper way to generate random password...
2013 Dec 09
0
[LLVMdev] [cfe-dev] ARM EABI and modulo
On Mon, Dec 09, 2013 at 03:11:45PM +0100, Joerg Sonnenberger wrote: > On Mon, Dec 09, 2013 at 01:58:29PM +0000, Renato Golin wrote: > > I can see the error, and it's just a bad selection of choices. I was > > wrong in assuming that the "eabi" at the end would always force it: > > > > $ clang -target arm-elf-eabi -S mod.c -o - | grep mod > > .file
2014 Nov 10
3
[LLVMdev] About inlining the modulo function in ARM architecture
...reply. On Mon, Nov 10, 2014 at 1:26 PM, Tim Northover <t.p.northover at gmail.com> wrote: > Hi Ray, > > On 10 November 2014 10:13, Alex S <alexmountain13 at gmail.com> wrote: > > Sorry for bothering those not interested. I found that ARM backend will > > insert a modulo function > > (like __modsi3) instead of the modulo instruction. I wonder how we can > > inline the modulo function > > into the program. Is there any OPTION we can use in the opt or llc? > > It depends on whether the CPU actually supports integer division. > Surprisingly...
2004 Aug 30
2
suggestions motivated by quest for remainders
Some time ago I tried to find out how to compute remainders in R. I now know that it is done with %%, which is documented in help('+'), but before someone told me that I tried: help('remainder'), help.search('remainder'), apropos('remainder') help('modulo'), help.search('modulo'), and apropos('modulo') all of which yielded nothing. I then tried help.search('mod') which yielded many pages of output, none of which seemed to be relevant to remainders. 1) Easy to implement small suggestion: Add 'remainder' and 'm...
2013 Dec 09
3
[LLVMdev] [cfe-dev] ARM EABI and modulo
On Mon, Dec 09, 2013 at 01:58:29PM +0000, Renato Golin wrote: > I can see the error, and it's just a bad selection of choices. I was > wrong in assuming that the "eabi" at the end would always force it: > > $ clang -target arm-elf-eabi -S mod.c -o - | grep mod > .file "mod.c" > bl __modsi3 > bl __umodsi3 I was discussing this with Tim on IRC and he
2017 Jun 01
1
Some questions about software pipeline in LLVM 4.0.0
...r and regalloc pass, there're some other passes like phi eliminate, two-address, register coalescing, which may change or insert intructions like 'copy' in MBB, and swp kernel loop may be destroyed by these passes. Why not put MachinePipeliner just before reg alloc pass like gcc's modulo scheduler does? In order to keep SSA pattern? I found many codes to process PHI nodes in MachinePipeliner.cpp. So I think if we move MachinePipeliner just before regalloc, it will simplify the data/resource dependency graph for SMS. Another question, in gcc, there's a flag BB_DISABLE_SCHE...
2018 Sep 11
1
Modification-proposal for %% (modulo) when supplied with double
...e core functionality to do unsolicited rounding behind the scenes. Best wishes, Frederick On Tue, Sep 11, 2018 at 12:11:29PM -0400, Duncan Murdoch wrote: > On 11/09/2018 11:23 AM, Emil Bode wrote: > > Hi all, > > > > > > > > Could we modify the "%%" (modulo)-operator to include some tolerance for rounding-errors when supplied with doubles? > > > > It's not much work (patch supplied on the bottom), and I don't think it would break anything, only if you were really interested in analysing rounding differences. > > > > A...
2010 Oct 09
3
[LLVMdev] [LLVMDev] Does LLVM have a random number generator?
Hello, does LLVM already have a Random Number Generator built into it's library somewhere? I know code generation is suppose to be deterministic, but when producing a random number can be deterministic if the random number generator is also deterministic. - Thanks - Jeff Kunkel
2018 Jul 24
2
Software pipeline using LLVM
Hi all, I want to generate assembly code using Swing Modulo Scheduling in LLVM for many ALU (May could be Adders, multilayer ......), I need some help how I can do that, which commend I run? Also if possible more information about the scheduling and the register location ......, and which pass responsible about that, and which LLVM version support Swing Mo...
2010 Oct 09
0
[LLVMdev] [LLVMDev] Does LLVM have a random number generator?
I am plugging this into my code. If someone wants to take it out and add it to the llvm library, it's a simple Linear Congruential Generator, but here it is: typedef struct random_number_gen { unsigned a, c, seed, m; random_number_gen( unsigned seed, unsigned modulo ) : seed(seed), m(modulo) { unsigned primes[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 }; a = 1 + primes[ seed % ( sizeof(primes)/sizeof(primes[0]) ) ]; c = primes[ modulo % ( sizeof(primes)/sizeof(primes[0]) ) ]; } unsigned rand() { return seed = (a*se...