home *** CD-ROM | disk | FTP | other *** search
- Path: news.eunet.fi!fipnet!kone!jsaarinen
- Newsgroups: comp.sys.amiga.programmer
- X-NewsReader: IntuiNews 1.2b (31.7.94)
- References: <311e8ed0@lls.se> <38232439@kone.fipnet.fi> <4g0bpp$gh1@maureen.teleport.com>
- From: "Jyrki Saarinen" <jsaarinen@kone.fipnet.fi>
- Date: Sun, 18 Feb 96 12:45:10 UT
- Comments: Illegal date header - new date added by quicknews
- X-Original-Date: Sun, 18 Feb 96 12:44:00
- MIME-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: binary
- Subject: Re: PPC compilers
- Message-ID: <38232460@kone.fipnet.fi>
-
-
- > : Let us try:
- >
- > : move.w d2,d4 ;u<<8
- > : move.l a0,d5 ;g<<8
- > : move.b d2,d4 ;+v
- > : addx.l d3,d2 ;u+=ustep
- > : move.b (a2,d4.w),d5 ;read texel
- > : addx.l d1,d0 ;v+=vstep
- > : move.b (a3,d5.l),(a4)+ ;read pixel from the shading table
- > : add.l a1,a0 ;g+=gstep
- >
- > I think this is faster on all 680x0 and uses 2 less register:
- > (6 free registers for the yloop, and is not bigger in byte size
- > then your version)
- >
- > move.w d1,d2 ;set texture ypos
- > addx.l d4,d1 ;step in texture
- > move.b d0,d2 ;set texture xpos
- > move.l d2,a0 ;texel address
- > move.l a2,d2 ;lighting table
- > addx.l d3,d0 ;step in texture
- > move.b (a0),d2 ;Set texel in lighting table
- > move.l d2,a0 ;Get lighting*texel adr in a usable reg
- > move.b (a0),(a1)+ ; write lighted texel
- > adda.l a3,a2 ; next light value
-
- Hmm. I guess that "move.l a2,d2" should be .w, because of 64k alignment
- of the shading table.
-
- But yes, using those 64k aligned tables is 28 cycles instead
- of 30. That is only 7% though .. But two more free registers,
- that is a great thing. Now, how do we schedule this loop
- for the maximum performance on the 68040 and the 68060?
-
- move.w d1,d2 ;set texture ypos
- addx.l d4,d1 ;step in texture
- move.b d0,d2 ;set texture xpos
- ;possible stall?
- move.l d2,a0 ;texel address
- move.l a2,d2 ;lighting table
- addx.l d3,d0 ;step in texture
- move.b (a0),d2 ;Set texel in lighting table
- ;possible stall?
- move.l d2,a0 ;Get lighting*texel adr in a usable reg
- move.b (a0),(a1)+ ; write lighted texel
- adda.l a3,a2 ; next light value
-
- -- _
- a Stellar programmer _ //
- "Amiga - back for the future" \X/
-