optimized X1000 executables

AmigaOne X1000 platform specific issues.

optimized X1000 executables

Postby ggw » Sat May 12, 2012 4:32 am

Are there cpu instructions specific to the X1000 as opposed to the AmigaOne at the user application layer?

What is a typical way to compile a c program that makes use of X1000's cpu specific code? How is it that the various libraries available at OS4Depot work on all the various cpus?

I can speculate, but would rather start down a less random path with my w(a|o)ndering.

Years ago I would specify 68000 / 010 / 020 / 030 (never got as far as 040 and 060) + FPU. For really old it was ancient seemingly one of a kind computers from the 1970s. Things got murkier when I later quit doing assembly and did c, depending on "IDE setups" which always happened to be on some flavor of Intel machine that was also the target. I got to where I didn't concern myself with the concept of cross compiling on those machines. (They seem to be backwardly compatible without much thought.... except hardware features being totally dropped.)

I will be easily satisfied with a reference to a discussion elsewhere that is specific to the general OS4 situation in this regard.
George Wyche
ggw
 
Posts: 13
Joined: Wed May 02, 2012 4:19 am

Re: optimized X1000 executables

Postby ChrisH » Sat May 12, 2012 11:01 am

I believe that the X1000's CPU supports AltiVec, and that would be your best bet for getting significant speed-ups. AlitVec also has the benefit of being supported by Eyetech AmigaOnes' (with a suitable CPU).
User avatar
ChrisH
Beta Tester
Beta Tester
 
Posts: 868
Joined: Mon Dec 20, 2010 9:09 pm

Re: optimized X1000 executables

Postby tonyw » Sun May 13, 2012 6:24 am

The usual way is to call IExpansion->GetMachineInfoTags();. This will tell you what sort of CPU the machine has, so you can branch to specific code at critical times.

For example:

IExpansion->GetMachineInfoTags(
GMIT_Machine, &machineType,
TAG_DONE);

Then switch on the returned value:

switch (machineType)
{
case MACHINETYPE_BLIZZARDPPC:
(etc)
}

Some machines (eg MACHINETYPE_AMIGAONE) will need more detail about Altivec CPUs, etc. You can use IExec->GetCPUInfoTags for that:

IExec->GetCPUInfoTags(
GCIT_Family, &cpuFamily,
GCIT_Model, &cpuType,
TAG_DONE);

See the autodocs/exec.doc and expansion.doc for details.
cheers
tony
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 462
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: optimized X1000 executables

Postby ggw » Tue May 15, 2012 2:48 pm

@tonyw

I guess this means that all of the libraries to date lack "special" support for X1000 cpus.

Library revision over time might add that support.

Thanks.
George Wyche
ggw
 
Posts: 13
Joined: Wed May 02, 2012 4:19 am

Re: optimized X1000 executables

Postby ChrisH » Wed May 16, 2012 11:31 pm

@ggw
IMHO, it does not make sense to optimise for a particular CPU in a particular machine (e.g. G4 in an original AmigaOne), because in general you will gain *very* little from it, but you will end-up with an executable(s) that almost no-one can use. IMHO it only makes sense to optimise for a particular CPU (or better, a CPU *feature*, e.g. AltiVec) when you will gain a significant speed advantage (e.g. 1/3 or more).

It always annoyed me when there were executables compiled for '000, '020, '030, '040 & '060, because I suspect that most of them performed (virtually) no different than any other, so they just wasted disk space & caused confusion. I especially suspect that the '020, '030 & '040 versions were virtually identical, such that you could get rid of the '030 & '040 versions without any problem. (The '000 is needed for compatibility with the oldest machines, while the '020 added cache support (rather important to not kill performance), and the '060 lost some instructions (and significantly differed in other aspects) thus making it somewhat incompatible anyway.)

The X1000's CPU already runs generic PPC executables very fast, so I don't really see the need for creating a special executable (except for AltiVec).
User avatar
ChrisH
Beta Tester
Beta Tester
 
Posts: 868
Joined: Mon Dec 20, 2010 9:09 pm

Re: optimized X1000 executables

Postby Slayer » Thu May 17, 2012 3:44 am

Oh come on ChrisH

It's part of Amiga history to try and tweak that extra cycle ;)

In the later years when I used to compile I'd use -m68020-60 eliminating cpu specific renditions (probably not as optimised as there pure incarnations though)

Does anyone know the exact switches one uses in the gcc command line for AmigaOS4.x gcc or are they listed in an AmigaOS4.x supplement?
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~
2x X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
3x Sam Flex (667MHz, 733MHz & 800MHz models) 1gM Radeon9250 AOS4.x
Sam 667MHz .5gM RadeonM9 AOS4.x
A4000D 604e 233Mhz .125gM Voodoo3 AOS4.x
User avatar
Slayer
Beta Tester
Beta Tester
 
Posts: 701
Joined: Tue Dec 21, 2010 4:19 am
Location: New Zealand


Return to Platform: AmigaOne X1000

Who is online

Users browsing this forum: No registered users and 3 guests