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

  1. Path: nntp.teleport.com!sschaem
  2. From: sschaem@teleport.com (Stephan Schaem)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Date: 15 Feb 1996 22:23:53 GMT
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Message-ID: <4g0bpp$gh1@maureen.teleport.com>
  8. References: <311e8ed0@lls.se> <38232439@kone.fipnet.fi>
  9. NNTP-Posting-Host: kelly.teleport.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Jyrki Saarinen (jsaarinen@kone.fipnet.fi) wrote:
  13.  
  14. : >  JS>         move.w  d2,d4           ;u<<8
  15. : >  JS>         move.l  a0,d5           ;g<<8
  16. : >  JS>         move.b  d2,d4           ;+v
  17. : >  JS>         move.b  (a2,d4.w),d5    ;read texel
  18. : >  JS>         move.b  (a3,d5.l),(a4)+ ;read pixel from the shading table
  19. : >  JS>         addx.l  d3,d2           ;u+=ustep
  20. : >  JS>         addx.l  d1,d0           ;v+=vstep
  21. : >  JS>         add.l   a1,a0           ;g+=gstep
  22. : > 
  23. : >  JS> That should be about 30 68020/68030 cycles per pixel.
  24. : > 
  25. : >  JS> Now, how the hell this should be scheduled for maximum
  26. : >  JS> performance on the 68040 and on the 68060? Anyone?
  27. : > 
  28. : > For the 68040, the only thing to be done is to put multi-cycle
  29. : > instructions before complex ("multicycle") addresses, but there are no 
  30. : >ásuch instructions here..
  31.  
  32. : What such instructions are?
  33.  
  34. : > For the 68060, try "reorder away" register dependancies. That is, try to
  35. : > make sure that two instructions can be executed in parallell. And in
  36. : > that aspect, nothing much can be done either.
  37. : > 
  38. : > Summary: I don't think you can do much better than it is.
  39.  
  40. : Let us try:
  41.  
  42. :        move.w  d2,d4           ;u<<8
  43. :        move.l  a0,d5           ;g<<8
  44. :        move.b  d2,d4           ;+v
  45. :        addx.l  d3,d2           ;u+=ustep
  46. :        move.b  (a2,d4.w),d5    ;read texel
  47. :        addx.l  d1,d0           ;v+=vstep
  48. :        move.b  (a3,d5.l),(a4)+ ;read pixel from the shading table
  49. :        add.l   a1,a0           ;g+=gstep
  50.  
  51.  I think this is faster on all 680x0 and uses 2 less register:
  52.  (6 free registers for the yloop, and is not bigger in byte size
  53.  then your version)
  54.  
  55.     move.w    d1,d2        ;set texture ypos
  56.     addx.l    d4,d1        ;step in texture
  57.     move.b    d0,d2        ;set texture xpos
  58.     move.l    d2,a0        ;texel address
  59.     move.l    a2,d2        ;lighting table
  60.     addx.l    d3,d0        ;step in texture
  61.     move.b    (a0),d2        ;Set texel in lighting table
  62.     move.l    d2,a0        ;Get lighting*texel adr in a usable reg
  63.     move.b    (a0),(a1)+    ; write lighted texel 
  64.     adda.l    a3,a2        ; next light value
  65.  
  66. : Is it any better now?
  67.  
  68.  Stephan
  69.