Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: AmigaMance on November 11, 2005, 04:07:21 PM

Title: 68k optimizations
Post by: AmigaMance on November 11, 2005, 04:07:21 PM
Hi.
 This is not a question about OS development, but i felt that only the experts here, can answer it. I am not a developer. :roll:
 Using the JumpGate patcher from Aminet, i discovered that many executables, libraries, devices etc. contains TONS of SW+CLR+SW and NOP instructions. Not just old files compiled for the 68000, but also "new", 040 optimized files!
 JumpGate replace the SW+CLR+SW with ANDI.L and the NOP with LEA (An). The second conversion is faster only if you have a 040+ cpu, as the guide states. ( I have a 68040)
 So far, i have use this utility to optimize many system files and i haven't encounter a problem, atm. Oh, BSR->BRA type of conversions, seems to be safe, too.
 Don't try this at home, as other optimizations are proven to be dangerous!! I always keep backup files.

 So, i have 2 questions about this:
- Are these optimizations always faster, or there are exceptions to this? I don't know a standard way to detect small changes in speed. (maybe you know one, btw)
- Are there any potential problems that i should know of?
Title: Re: 68k optimizations
Post by: SamuraiCrow on November 11, 2005, 04:28:08 PM
The main reason a NOP can make an executable faster is that it can allow a loop to be aligned to a row of cache memory in the code cache.  This allows the entire cache to be filled with code from the loop and speed things up substantially.  The code cache on an '040 is 4k and '060 is even bigger.
Title: Re: 68k optimizations
Post by: Piru on November 11, 2005, 04:47:00 PM