15 November 2019, 16:26 | #1 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
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) |
15 November 2019, 16:36 | #2 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
The size of the index register doesn't matter regarding cycles.
|
15 November 2019, 16:45 | #3 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,410
|
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. |
15 November 2019, 16:47 | #4 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
|
15 November 2019, 16:58 | #5 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
|
|
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 09:05 |
Address register expected | Nightfox | Coders. Asm / Hardware | 4 | 12 August 2016 11:51 |
indirect Filesystem autoconfig | Leandro Jardim | support.WinUAE | 5 | 09 September 2015 12:54 |
WinUAE Debugger - Address Register Watchpoints | SparkyNZ | Coders. Asm / Hardware | 3 | 16 June 2015 22:39 |
Word vs not word aligned playfield question | nandius_c | Coders. Asm / Hardware | 8 | 03 December 2013 12:03 |
|
|