English Amiga Board


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

 
 
Thread Tools
Old 12 October 2011, 19:55   #21
Photon
Moderator

Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 4,733
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.
Photon is offline  
Old 12 October 2011, 20:24   #22
pmc
gone
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by Thorham
Did you try Photon's REPT idea? Gets rid of the dbf instructions, and without caches and pipelines (68020+) this will most certainly be faster.
No, not yet - I'm very busy at the moment and have had no time but as soon as I get some of that precious commodity I will be trying it!

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
pmc 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
OS X Quick Look plugin for IFF ILBM images dalton News 12 06 February 2016 01:59
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

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 17:49.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.05942 seconds with 15 queries