Amiga.org

Operating System Specific Discussions => MorphOS => MorphOS -- Application questions and support => Topic started by: amigadave on November 05, 2009, 04:32:36 AM

Title: AmiSSL install on MorphOS
Post by: amigadave on November 05, 2009, 04:32:36 AM
I think all of the MorphZone users have gone to sleep, so I will ask this question here, as well as there.

When installing AmiSSL on any MorphOS computer (PPC) which of the three version choices should be used?

1.  68000/68010
2.  68020/68030/68040
3.  68060

I don't know enough about MorphOS's Trance 68k emulation to know which one to pick.
Title: Re: AmiSSL install on MorphOS
Post by: Piru on June 16, 2010, 11:56:36 AM
Quote from: amigadave;528417
When installing AmiSSL on any MorphOS computer (PPC) which of the three version choices should be used?

1.  68000/68010
2.  68020/68030/68040
3.  68060

I don't know enough about MorphOS's Trance 68k emulation to know which one to pick.
Ah I only noticed this old post now, but since this is more of a generic question (which CPU type to choose when installing 68k apps) it deserves an explanation.

Trance emulates a 68060 with a FPU. However, it doesn't have the problems the original 68060: Missing opcodes. Real 68060 for instance cannot execute certain instructions without falling into emulation. Instruction scheduling required by the real 68060 isn't really needed, as trance generates assembly for PowerPC where the scheduling is different anyway. Trance does heavy optimization of the resulting PowerPC code, which again makes it less relevant how the original 68k code was optimized. Trance emulated 68k code can reach up to 75% performance of the native PowerPC code.

68000/68010 code typically requires complex routines to perform 32bit and 64bit multiplication and divisions, so you should choose 68020+ version if possible. Other than that it really makes little difference which CPU version (68020/68030/68040/68060) you choose. All of them should be pretty much as fast.
Title: Re: AmiSSL install on MorphOS
Post by: Karlos on June 16, 2010, 12:12:36 PM
Quote from: Piru;564835
Thus it really makes little difference which CPU version you choose. All of them should be pretty much as fast.


Does it know to optimise 68000 integer arithmetic used to implement long multiplication and the like? At the very least I would have assumed that 68020 would be your best starting point since it doesn't require chains of instructions to implement certain operations you'd take for granted on 020+.
Title: Re: AmiSSL install on MorphOS
Post by: Piru on June 16, 2010, 12:17:36 PM
Quote from: Karlos;564837
Does it know to optimise 68000 integer arithmetic used to implement long multiplication and the like?
It doesn't. It could be added but I don't think many apps spend that much time in multiplications/divisions and the like. Also, if the application is speed critical in this area it typically has an option to choose 68020 or higher CPU, or it automagically switches to faster routines when 68020+ is detected. If this really is an issue you can always use http://aminet.net/package/util/misc/PatchFor020 manually.

Quote
At the very least I would have assumed that 68020 would be your best starting point since it doesn't require chains of instructions to implement certain operations you'd take for granted on 020+.
Indeed 68020+ is the best choice. I meant to say any of 68020/68030/68040/68060 is pretty much the same. I'll fix the post.

It should be pointed out however that since powerpc assembly is much more fine grained than the 680x0, the differences in common 68000 and 68020 code get optimized away. For instance in the following example where 68000 requires 2 instructions over 68020's 1...
68000:
Code: [Select]
lsl.l  #3,d0
move.l 4(a0,d0.l),d0
68020:
Code: [Select]
move.l 4(a0,d0.l*8),d0

...will result in identical powerpc assembly (note that d0 is overwritten here, so the JIT knows that original d0 value is no longer used. Trance does very sophisticated analysis of the 68k code and can optimize away "unnecessary" code like this). Similarily for instance the new 020+ addressing modes eventually resolve the very similar code, regardless if you use separate 68000 compatible instructions or the new 020+ addressing mode.

But since this doesn't work for everything (for instance the code used for 32/64 bit multiplications and divisions), you're better off by choosing 68020+ version of binaries.