Compiler Machine Dependent Options for XScale

Option

Description

-mapcs-frame

Generates a stack frame upon entry to a function, as defined in the ARM ® Procedure Calling Standard (APCS).

-mno-apcs-frame

Does not generate a stack frame upon entry to a function. The APCS specifies generating stack frames produces slightly smaller and faster code.   This is the default setting.

-mapcs-32

Procedure calling standard.   This is the default setting.

-mapcs-26

Produces assembly code that conforms to the 26-bit version of the APCS, as used by earlier versions of the ARM processor (ARM2 and ARM3).

-mapcs-stack-check

Produces assembly code that checks the amount of stack space available upon entry to a function, calling a suitable function if insufficient stack space is available.

-mno-apcs-stack-check

Does not produce code to check for stack space upon entry to a function. This is the default setting.

-mapcs-reentrant

Produces assembly code that is position independent and reentrant.

-mno-apcs-reentrant

Does not produce position independent, reentrant assembly code. This is the default setting.

-matpcs

Generates code that conforms to the new ARM Thumb® Procedure Calling Standard (ATPCS) specification from ARM. This is a new procedure call standard, and it is slightly incompatible with the old PCS. By default this option is not enabled. The incompatibility between the standards is in the area of functions that return small structures. With ATPCS, any function returning a structure that will fit in one word returns the structure in register zero. With APCS, this only happens if the structure meets some other constraints (such as having one   addressable field); otherwise, the structure is returned in memory instead.

-mno-atpcs

Generates code that conforms to the APCS. This is the default.

-mbig-endian

Produces assembly code targeted for a big-endian processor.

-mlittle-endian

Produces assembly code targeted for a little-endian processor. This is the default setting.

-mwords-little-endian

Produces assembly code which is targeted for a big-endian processor, but which stores words in a little-endian format. This is for backward compatibility with older versions of gcc.

-mbuggy-return-in-memory

For compatibility with older toolchains, since previous releases of GNUPro Toolkit for the ARM processors had a bug for handling functions that returned small structures. The old code would cause a function that returned a structure to return the structure in memory. This is incorrect according to the APCS. The structure should be returned in register zero. This option only affects functions that return structures which only contain a single floating-point value, so it is not likely to affect much code generation.

-mno-buggy-return-in-memory

Disables compatibility with older toolchains (functions returning small structures). With this option enabled, the GNUPro Toolkit for the ARM is fully compliant with the APCS. This option is enabled by default.

-mfpe

Floating-point instructions should be emulated by the ARM Floating-Point Emulator code, which is supplied by the operating system.

-mfpe= N

Floating-point instructions should be emulated by the ARM Floating-Point Emulator code version N; valid version numbers being two and three; two (2) is the default setting.

-mlong-calls

Allows function calls outside of the normal 26-bit address range.

-malignment-traps

Use this option, if the hardware has been configured to fault when non-aligned memory accesses are made in the MMU, to direct gcc to take extra care not to generate instructions that might cause these faults, even though this may result in less efficient code.

-mhard-float

For floating-point instructions performed in hardware. This option does not apply to code generated for the XScale target.

-mpoke-function-name

Causes the compiler to store the name of each function it compiles as an ASCII string in the assembler output, just before the start of the function, and follows it with a readily identifiable number:

.L1:

.ascii ‘foo’, 0

.align

.L2:

.word 0xff000000 + (L2 - L1)

foo:

... start of function foo ...

-mabort-on-noreturn

Causes the compiler to generate a call to the function abort() at the end of a function which as the noreturn attribute. This is disabled by default, since there is no guarantee that the host operating system will provide an abort() function call.

-msched-prolog

Allows instructions in function prologues to be rearranged to improve performance. This is the default setting.

-mno-sched-prolog

Does not allow the instructions in function prologues to be rearranged, guaranteeing that function prologues will have a well-defined form.

-mthumb

Generates Thumb instructions rather than ARM/XScale instructions.

-mtpcs-frame

Generates stack backtrace frames for non-leaf functions, if ‘ -mthumb’ has been specified.

-mtpcs-leaf-frame

Generates stack backtrace frames for leaf functions, if ‘-mthumb’ has been specified.

-mcallee-super-interworking

Assumes that non-static functions might be called in ARM mode, if ‘-mthumb’ has been specified.

-mcaller-super-interworking

Assumes that function pointers might point at non interworking aware code, if ‘-mthumb’ has been specified.

-mthumb-interwork

Produces assembly code which supports calls between the ARM instruction set and the Thumb instruction set.

-mno-thumb-interwork

Does not produce code specifically intended to support calling between ARM and Thumb instruction sets. This is the default setting.

-mcpu= XXX

Produces assembly code specifically for the indicated processor. The XXX variable uses the xscale processor.

Important: If ‘-mcpu’ is not specified, the default is to generate code for the XScale .

-march= XXX

Produce assembly code specifically for an ARM processor of the indicated architecture. The XXX variable can be one of the following architectures: armv2, armv2a , armv3, armv3m , armv4, armv4t , and armv5.

Important: If ‘-march’ is not specified, the default is to generate code for the armv5.

 

© 2010 Microcross, Inc.  All rights reserved.