home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1939 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.6 KB  |  51 lines

  1. Path: ifi.uio.no!usenet
  2. From: ludvigp@ifi.uio.no (Ludvig Pedersen)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Date: 25 Jan 1996 11:36:25 GMT
  6. Organization: Dept. of Informatics, University of Oslo, Norway
  7. Message-ID: <1205.6597T1252T932@ifi.uio.no>
  8. References: <4d42gg$i2p@ra.ibr.cs.tu-bs.de> <4dov8s$rc5@ar.ar.com.au> <38232132@kone.fipnet.fi>
  9. NNTP-Posting-Host: gymir.ifi.uio.no
  10. X-Newsreader: THOR 2.22 (Amiga;TCP/IP)
  11.  
  12.  
  13. >> To do fast 16:16 bit fixed point maths (ie for bitmap scaling). You have
  14. >> the fraction in the  high word and the integer part in the low word.
  15. >>áBecause of the addx, every time the fraction wraps around, the X bit is set
  16. >>áand next add, the integer bit is incremented.
  17. >Addx is really great .. Hmm. We could think of all the
  18. >situations where addx could possibly go wrong. (I mean
  19. >fixed point interpolations)
  20. >At least this has to be done before the loop:
  21. >        moveq   #0,d0
  22. >        add.l   d1,d0
  23.  
  24. >        ...
  25. >.loop   addx.l  d1,d2
  26. >        dbf     d7,.loop
  27.  
  28. >But what about if there is two addx? Theis decimal parts
  29. >have to be switched, which is done nicely with eor
  30. >before swapping, but what about that before loop
  31. >correction? Of course this perfect accuracy
  32. >is not required on 16.16 fixed point but if
  33. >there is a smaller amount of fraction, the
  34. >errors can be quite big..
  35.  
  36. Using
  37.         sub.w   dx,dx
  38.  
  39. instead of
  40.  
  41.         moveq   #0,d0
  42.         add.l   d1,d0
  43.  
  44. is faster by-the-way. And since we are only using the lower word of the
  45. register we don't need to use an extra dataregister.
  46.  
  47. <sb>Ludde - Amiga Demo Coder
  48. <sb>Virtual Reality & Official Be developer
  49. <sb>ludvigp@ifi.uio.no
  50.  
  51.