home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.compilers
- Path: sparky!uunet!world!iecc!compilers-sender
- From: tve@crackle.CS.Berkeley.EDU (Thorsten von Eicken)
- Subject: Re: Modulo n arithmetics
- Reply-To: tve@crackle.CS.Berkeley.EDU (Thorsten von Eicken)
- Organization: University of California, Berkeley
- Date: Fri, 20 Nov 1992 00:55:35 GMT
- Approved: compilers@iecc.cambridge.ma.us
- Message-ID: <92-11-116@comp.compilers>
- Keywords: arithmetic
- References: <92-11-029@comp.compilers>
- Sender: compilers-sender@iecc.cambridge.ma.us
- Lines: 18
-
- Christian Fabre <fabre@gr.osf.org> writes:
- >I am wondering if any languages or application heavily rely on
- >modulo arithmetics:
-
- On parallel machines without hardware support for a global address space a
- global pointer can be represented as a 64bit <proc,addr> pair (processor
- and local address). If you want to interleave global memory, then pointer
- arithmetic requires lots of (mod P), where P is the number of processors:
- e.g. "ptr+5", where ptr is a global pointer, turns into
-
- ptr.addr += (ptr.proc+5)/P; ptr.proc = (ptr.proc+5)%P;
-
- Of course, if P is a power of two, you can use shifts and masks.
-
- Thorsten von Eicken
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-