English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 15 November 2019, 17:26   #1
deimos
Registered User

 
Join Date: Jul 2018
Location: France
Posts: 537
Address register indirect, word vs long

The one bit of code I have where the performance matters the most has at the heart of it a move.w instruction where I need to choose a destination addressing mode of (An, Dn.w) or (An, Dn.l).

If I chose the former I can't use interleaved bitmaps, if I chose the latter I can. If I chose to mix in bits of blitter stuff then interleaved bitmaps make so much more sense (just normal blits, not line drawing or filling), but I need to understand the cost.

I can make an estimate of how many times this characteristic move instruction will get called per frame, but how do I go from information like this that I found online:

Code:
d(An,ix)	Address register indirect, index	10(2/0)	14(3/0)
to an actual human relatable number?
deimos is offline  
Old 15 November 2019, 17:36   #2
hooverphonique
ex. demoscener "Bigmama"

 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,044
The size of the index register doesn't matter regarding cycles.
hooverphonique is offline  
Old 15 November 2019, 17:45   #3
roondar
Registered User

 
Join Date: Jul 2015
Location: The Netherlands
Posts: 1,621
The numbers you mention seem wrong, a move from d(an,ix) is never as low as 10 cycles. For reference, I use this site for my CPU timing info: http://oldwww.nvg.ntnu.no/amiga/MC68...000timing.HTML

Anyway, the numbers in parentheses show the number of memory read/write cycles/actions the instruction causes on the bus, the number in front of the parentheses shows the number of cycles the instruction takes.

If we look at move.w d(an,ix) on the site I linked above, we see that the instruction costs a minimum of 14 cycles (when moving a word from d(an,ix) to dx) and a maximum of 26 cycles (when moving a word from d(an,ix) to an absolute long address). For longs we can see it is between 18 cycles (when moving a long from d(an,ix) to dx) and a maximum of 34 cycles (when moving a long from d(an,ix) to an absolute long address).

Then simply compare this to the speed of the CPU, which does about 7 million cycles per second/140.000 cycles per PAL frame.

In short, using words can be quite a bit faster - but if depending on the opcode, the difference can be fairly small.

Edit: I misread your post, I thought you wanted to know the difference in speed between move.w <blah> and move.l <blah>. Ignore what I said, hooverphonique is correct.
roondar is offline  
Old 15 November 2019, 17:47   #4
deimos
Registered User

 
Join Date: Jul 2018
Location: France
Posts: 537
Quote:
Originally Posted by hooverphonique View Post
The size of the index register doesn't matter regarding cycles.
I see. I was misreading - word vs long is the size of the data being written. In that case I need to go back and look at what I've done.
deimos is offline  
Old 15 November 2019, 17:58   #5
deimos
Registered User

 
Join Date: Jul 2018
Location: France
Posts: 537
Quote:
Originally Posted by roondar View Post
The numbers you mention seem wrong, a move from d(an,ix) is never as low as 10 cycles. For reference, I use this site for my CPU timing info: http://oldwww.nvg.ntnu.no/amiga/MC68...000timing.HTML

Anyway, the numbers in parentheses show the number of memory read/write cycles/actions the instruction causes on the bus, the number in front of the parentheses shows the number of cycles the instruction takes.

...

Then simply compare this to the speed of the CPU, which does about 7 million cycles per second/140.000 cycles per PAL frame.
Thank you, that site looks to have all the data and even explains it, and says, as hooverphonique did, "The size of the index register (ix) does not affect execution time".
deimos is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange indirect addressing with index Soundy support.WinUAE 3 23 July 2019 10:05
Address register expected Nightfox Coders. Asm / Hardware 4 12 August 2016 12:51
indirect Filesystem autoconfig Leandro Jardim support.WinUAE 5 09 September 2015 13:54
WinUAE Debugger - Address Register Watchpoints SparkyNZ Coders. Asm / Hardware 3 16 June 2015 23:39
Word vs not word aligned playfield question nandius_c Coders. Asm / Hardware 8 03 December 2013 13:03

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:15.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.06479 seconds with 13 queries