Datasheet
ARM Compiler Reference
3-10 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
Standard keywords
These keywords declare a storage class.
register
Using the ARM compilers, you can declare any number of local objects
(auto variables) to have the storage class
register
.
Note
Using
register
is not recommended because the compiler is very
effective at optimizing code. The
register
keyword is regarded by the
compiler as a suggestion only. Other variables, not declared with the
register
keyword, can be kept in registers and register variables can be
kept in memory. Using
register
might increase code size because the
compiler is restricted in its use of registers for optimization.
Depending on the variant of the ATPCS being used, there are between
five and seven integer registers available, and four floating-point
registers. In general, declaring more than four integer register variables
and two floating-point register variables is not recommended.
The following object types can be declared to have the
register
storage
class:
• All integer types (
long
long
occupies two registers).
• All integer-like structures. That is, any one word
struct
or
union
where all addressable fields have the same address, or any one word
structure containing bitfields only. The structure must be padded to
32 bits.
• Any pointer type.
• Floating-point types. The double-precision floating-point type
double
occupies two ARM registers if software floating-point is
used.
ARM-specific keywords
The keywords in this section are used to declare or modify variable definitions:
__int64
This type specifier is an alternative name for type
long long
. This is
accepted even when using
-strict
.
__global_reg(vreg)
This storage class allocates the declared variable to a global integer
register variable. If you use this storage class, you cannot also use any of
the other storage classes such as extern, static, or typedef.
vreg
is an
ATPCS callee-save register (for example, v1) and not a real register