Revision history for CompilerOptarch


Revision [21666]

Last edited on 2016-11-07 03:18:49 by fxm [Formatting]
Additions:


Revision [21663]

Edited on 2016-11-06 17:46:51 by fxm [Formatting]

No Differences

Revision [19909]

Edited on 2016-02-10 15:45:29 by DkLwikki [Update link format]
Additions:
The exact impact which the ##-arch## setting has on code generation depends on the [[CompilerOptgen|code generation backend]] that is being used. The x86 ASM backend (##-gen gas##) handles the ##-arch## setting and adjusts code generation accordingly in some cases. When using the GCC backend (##-gen gcc##), the specified architecture will be passed on to gcc via ##gcc -march=<...>##, causing gcc to generate code for the specified architecture.
Specifying an ##-arch## setting incompatible to the native architecture will trigger [[DevCrossCompiling|cross-compilation]], just like the ##[[CompilerOpttarget|-target]]## option, except that only the target architecture, but not the target operating system, is changed.
- [[CompilerCmdLine|Using the Command Line]]
- [[CompilerOpttarget|-target]]
- [[DevCrossCompiling|FB and cross-compiling]]
Deletions:
The exact impact which the ##-arch## setting has on code generation depends on the [[CompilerOptgen code generation backend]] that is being used. The x86 ASM backend (##-gen gas##) handles the ##-arch## setting and adjusts code generation accordingly in some cases. When using the GCC backend (##-gen gcc##), the specified architecture will be passed on to gcc via ##gcc -march=<...>##, causing gcc to generate code for the specified architecture.
Specifying an ##-arch## setting incompatible to the native architecture will trigger [[DevCrossCompiling cross-compilation]], just like the ##[[CompilerOpttarget -target]]## option, except that only the target architecture, but not the target operating system, is changed.
- [[CompilerCmdLine Using the Command Line]]
- [[CompilerOpttarget -target]]
- [[DevCrossCompiling FB and cross-compiling]]


Revision [17225]

Edited on 2014-08-30 11:14:02 by DkLwikki [Overhaul and update for 64bit/ARM]
Additions:
Set target architecture for improved/restricted code generation or cross-compiling
Deletions:
Set target architecture


Revision [17224]

Edited on 2014-08-30 11:09:38 by DkLwikki [Overhaul and update for 64bit/ARM]
Additions:
Specifying an ##-arch## setting incompatible to the native architecture will trigger [[DevCrossCompiling cross-compilation]], just like the ##[[CompilerOpttarget -target]]## option, except that only the target architecture, but not the target operating system, is changed.
Deletions:
Specifying an ##-arch## setting incompatible to the native architecture will trigger [[DevCrossCompiling cross-compilation]], just like the ##[[CompilerOpttarget -target]]## option, except that only the target architecture, but not the operating system, is changed.


Revision [17223]

Edited on 2014-08-30 11:08:51 by DkLwikki [Overhaul and update for 64bit/ARM]
Additions:
- Improving code generation; for example: You can use ##-arch 686## to override the default ##-arch 486##, and the compiler will generate faster code in some cases, by using certain instructions which were not available on i486 (or other CPUs older than i686).
- Restricting code generation; for example: You can use ##-arch 386## to limit the compiler to using only i386-compatible instructions.
- Cross-compiling; for example: You can use ##-arch x86_64## on 32bit x86 systems to cross-compile to 64bit x86_64.
Deletions:
- Improving code generation, for example: You can use ##-arch 686## to override the default ##-arch 486##, and the compiler will generate faster code in some cases, by using certain instructions which were not available on i486 (or other CPUs older than i686).
- Restricting code generation, for example: You can use ##-arch 386## to limit the compiler to using only i386-compatible instructions.
- Cross-compiling. and even to trigger cross-compiling, as an alternative to, or together with, the [[CompilerOpttarget -target option]].


Revision [17222]

Edited on 2014-08-30 11:07:44 by DkLwikki [Overhaul and update for 64bit/ARM]
Additions:
The target architecture. Recognized values:

- Related to 32bit x86:
- ##386##
- ##486## (default for x86)
- ##586##
- ##686##
- ##athlon##
- ##athlon-xp##
- ##athlon-fx##
- ##k8-sse3##
- ##pentium-mmx##
- ##pentium2##
- ##pentium3##
- ##pentium4##
- ##pentium4-sse3##
- Related to 64bit x86_64:
- ##x86_64##, ##x86-64##, ##amd64##
- Related to 32bit ARM:
- ##armv6##
- ##armv7-a## (default for ARM)
- Related to 64bit ARM (""AArch64""):
- ##aarch64##
- Others:
- ##native##: For compiling to the architecture which the compiler is running on.
- ##32##, ##64##: For quick cross-compiling to the 32bit or 64bit version of the default architecture.
The ##-arch## compiler option sets the target CPU architecture. This can be used for multiple purposes:

- Improving code generation, for example: You can use ##-arch 686## to override the default ##-arch 486##, and the compiler will generate faster code in some cases, by using certain instructions which were not available on i486 (or other CPUs older than i686).
- Restricting code generation, for example: You can use ##-arch 386## to limit the compiler to using only i386-compatible instructions.
- Cross-compiling. and even to trigger cross-compiling, as an alternative to, or together with, the [[CompilerOpttarget -target option]].

The exact impact which the ##-arch## setting has on code generation depends on the [[CompilerOptgen code generation backend]] that is being used. The x86 ASM backend (##-gen gas##) handles the ##-arch## setting and adjusts code generation accordingly in some cases. When using the GCC backend (##-gen gcc##), the specified architecture will be passed on to gcc via ##gcc -march=<...>##, causing gcc to generate code for the specified architecture.

However, ##-arch## only affects newly generated code, but not pre-compiled code such as the ""FreeBASIC"" runtime libraries, or any other library from the ##lib/## directory. For example, using ##-arch 386## is not necessarily enough to get a pure i386 executable -- it also depends on how all the libraries that will be linked in were compiled.

The ##-arch 32## and ##-arch 64## shortcuts are similar to gcc's ##-m32/-m64## options. On 32bit architectures, ##-arch 64## is an abbreviation for cross-compiling to the default 64bit version of the architecture (e.g. from 32bit x86 to 64bit x86_64, or 32bit ARM to 64bit ""AArch64""), and ##-arch 32## does nothing. On 64bit systems, it is the other way round: ##-arch 32## cross-compiles to the default 32bit architecture, while ##-arch 64## does nothing.

The ##-arch native## shortcut is similar to gcc's ##-march=native## option. On x86, it causes fbc to try and detect the host CPU automatically based on the ##cpuid## instruction and its availability or results. On other architectures, this will currently simply use the architecture which the compiler itself was built for. Under -gen gcc this will use ##gcc -march=native##.

Specifying an ##-arch## setting incompatible to the native architecture will trigger [[DevCrossCompiling cross-compilation]], just like the ##[[CompilerOpttarget -target]]## option, except that only the target architecture, but not the operating system, is changed.
- [[CompilerOpttarget -target]]
- [[DevCrossCompiling FB and cross-compiling]]
Deletions:
The target architecture.
The ##-arch## compiler option sets the target CPU architecture. The default is //486// if the //-arch// option is not specified. Recognized values:
//386//
//486//
//586//
//686//
//athlon//
//athlon-xp//
//athlon-fx//
//k8-sse3//
//pentium-mmx//
//pentium2//
//pentium3//
//pentium4//
//pentium4-sse3//
//native//
Note: This option only affects newly generated code, not already-compiled code such as the ""FreeBASIC"" runtime libraries.


Revision [15134]

Edited on 2011-07-31 14:49:52 by DkLwikki [Note: -arch doesn't affect the choice of runtime]
Additions:
Note: This option only affects newly generated code, not already-compiled code such as the ""FreeBASIC"" runtime libraries.


Revision [14821]

Edited on 2010-08-25 07:53:08 by DkLwikki [Added all values recognized for -arch]
Additions:
The ##-arch## compiler option sets the target CPU architecture. The default is //486// if the //-arch// option is not specified. Recognized values:
//386//
//486//
//586//
//686//
//athlon//
//athlon-xp//
//athlon-fx//
//k8-sse3//
//pentium-mmx//
//pentium2//
//pentium3//
//pentium4//
//pentium4-sse3//
//native//
Deletions:
The ##-arch## compiler option sets the target CPU architecture. The default is //486// if the //-arch// option is not specified. Can be one of //386//, //486//, //586//, or //686//.


Revision [12198]

The oldest known version of this page was created on 2008-01-18 14:06:32 by JeffMarshall [Added all values recognized for -arch]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode