12 October 2011, 19:55 | #21 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
It will inescapably be faster. More than double the speed for the fill, and a little less than double the speed for the copy, on the 68000. Also, there is no faster way that's easier to code.
REPT 256 will take about 512 bytes more in code-size than before, for each of the two loops. You can make two odd- and even- aligned REPT 128 x move.w in the same code-size of one REPT 256 x move.b, but for the copy loop you need a fallback 256xmove.b code chunk for 50% of the cases - exactly one of source and destination are odd. Won't work with a word copy then. Too much special cases and you will kill the performance of small loops. I prefer to divide by say 16 (lsr #4), do the remainder as a dbf loop, then the quotient (if non-0) for a REPT 16 loop. (I called this to "splay out" a loop in 1991, sounds silly now) If you write the code to favor early-exit (as in low cycle count) for counts < 16, you have a general-purpose and not too obfuscated reusable loop unraveling method. |
12 October 2011, 20:24 | #22 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Thanks for that tip Photon - will let you guys know the speed improvement once I've got it implemented successfully. EDIT: My son fell asleep early and my wife is out so I had some time this evening \o/ New routine with offset jmps instead of dbf loops now implemented and working fine and fast Last edited by pmc; 12 October 2011 at 21:44. Reason: Update |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OS X Quick Look plugin for IFF ILBM images | dalton | News | 17 | 01 September 2021 22:24 |
help optimising a section of code | h0ffman | Coders. General | 15 | 02 March 2011 13:19 |
ILBM picture | mai | support.Other | 27 | 31 July 2010 13:30 |
IFF/ILBM structures .... | freddix | Coders. General | 7 | 18 September 2006 09:54 |
ILBM files - different versions? | TikTok | Coders. General | 2 | 07 March 2005 12:00 |
|
|