Displaying 3 results from an estimated 3 matches for "unordinari".
Did you mean:
unordinary
2013 Nov 15
2
[LLVMdev] Modular arithmetic processors
I've been playing around with LLVM to write a backend for a rather "simple"
(co-)processor. Assume that only three arithmetic instructions exist: ADD
mod N, SUB mod N and MUL mod N. The modulus N is programmable and stored in
a register. No ordinary arithmetic instructions are available. The word
size is 256-bit.
In other words, the following function, b + c mod N, corresponds to
2013 Nov 15
0
[LLVMdev] Modular arithmetic processors
Hi,
My personal opinion: Just to be sure I understand what you're considering:
you want to write a backend that will produce optimized machine code for a
device with modular arithmetic instructions (not simulate such a device on
a standard CPU)? In which case, won't the same assumptions that are
embodied in the transformations for the case of unsigned 2's complement
arithmetic (in
2013 Nov 18
1
[LLVMdev] Modular arithmetic processors
Thanks for your insightful suggestions.
Yes, I am programming for a real device that does modular arithmetic (and
only modular arithmetic). The modulus N is fixed during a single launch of
a program. One way I could also come up with is to simply use add i256 %a,
%b to represent a + b mod n, and let LLVM passes to reason about possible
optimizations. However these are not semantically identical