jump to navigation

Six years later… August 23, 2005

Posted by winden in coding, demoscene.
trackback

Today I was a having a refreshment about 68030 and 68060 optimizing, and found out a nice detail: both 127(a0,d0) and 127(pc,d0) addressing modes take the same time to execute! :) What does this mean:

A. Good things: In a texture mapping loop, we could address the texture using pc-relative addressing, which means that we get a free address register for other purposes.

B. Bad things: For each texture we want to use with a texturing loop, we have to copy the loob body just below the texture memory.

Some examples, first the old standard way:

loop:
 move.w d0,d6
 move.b d1,d6
 addx.l d2,d0
 addx.l d3,d1
 move.b (a0,d6.l),(a1)+
 dbf d7,loop
 rts

and now the “new and improved” way:

loop:
 move.w d0,d6
 move.b d1,d6
 addx.l d2,d0
 addx.l d3,d1
 move.b (tex-*)(pc,d6.l),(a1)+
 dbf d7,loop
 rts

cnop 0,4
tex:
 incbin texture.raw

UPDATE 24/08/2005:

Of course the times were the same for adress-register-relative and pc-relative addressing, but it was re-reading that specific piece together with having been working for some hours on texturemappers that led me to the “logical” result of instancing a new filler specifically for each texture.

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: