home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / compiler / 1925 < prev    next >
Encoding:
Text File  |  1992-11-21  |  1.2 KB  |  33 lines

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