Datasheet
C and C++ Compilers
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-27
Note
Using this option increases code size and decreases performance slightly.
This option does not split ARM inline assembly
LDM
or
STM
instructions,
or VFP
FLDM
or
FSTM
instructions, but does split Thumb
LDM
and
STM
inline
assembly instructions where possible. Using inline Thumb assembly
routines, however, is deprecated and generates a warning message.
This option has no significant benefit for cached systems, or for
processors with a write buffer.
This option also has no benefit for systems with non-zero-wait-state
memory, or for systems with slow peripheral devices. Interrupt latency in
such systems is determined by the number of cycles required for the
slowest memory or peripheral access. This is typically much greater than
the latency introduced by multiple register transfers.
Setting the default type of unqualified floating-point constants
-auto_float_constants
This option changes the type of unsuffixed floating-point constants from
double
(as specified by the ANSI/ISO C and C++ standards) to
unspecified. In this context, unspecified means that uncast
double
constants and
double
constant expressions are treated as
float
when used
in expressions with values other than
double
. This can sometimes
improve the execution speed of a program that uses
float
variables.
Compile-time evaluation of constant expressions that contain such
constants is unchanged. The compiler uses double-precision calculations,
but the unspecified type is preserved. For example:
(1.0 + 1.0) // evaluates to the floating-point
// constant 2.0 of double precision and
// unspecified type.
In a binary expression that must be evaluated at runtime (including
expressions that use the ?: operator), a constant of unspecified type is
converted to
float
, instead of
double
. The compiler issues the following
warning:
C2621W: double constant automatically converted to float
You can avoid this warning by explicitly suffixing floating-point
constants that you want to be treated as
float
with an
f
as shown in
Example 2-1 on page 2-28. You can turn this warning off with the
-Wk
compiler option.