Atmel CAVR-4 Manual De Usuario

Descargar
Página de 323
CAVR-4
10
Basic settings for project configuration
AVR® IAR C/C++ Compiler
Reference Guide
Your program may use only one memory model at a time, and the same model must be 
used by all user modules and all library modules. 
Summary of memory models
The following table summarizes the characteristics for each memory model:
SIZE OF DOUBLE FLOATING-POINT TYPE
Floating-point values are represented by 32- and 64-bit numbers in standard IEEE754 
format. By enabling the compiler option 
--64bit_doubles
, you can choose whether 
data declared as 
double
 should be represented with 32 bits or 64 bits. The data type 
float
 is always represented using 32 bits.
OPTIMIZATION FOR SPEED AND SIZE
The AVR IAR C/C++ Compiler is a state-of-the-art compiler with an optimizer that 
performs, among other things, dead-code elimination, constant propagation, inlining, 
common sub-expression elimination, and precision reduction. It also performs loop 
optimizations, such as induction variable elimination.
You can decide between several optimization levels and two optimization goals—size 
and speed. Most optimizations will make the application both smaller and faster. 
However, when this is not the case, the compiler uses the selected optimization goal to 
decide how to perform the optimization.
The optimization level and goal can be specified for the entire application, for individual 
files, and for individual functions. In addition, some individual optimizations, such as 
function inlining, can be disabled.
For details about compiler optimizations, see Controlling compiler optimizations, page 
122
. For more information about efficient coding techniques, see the chapter Efficient 
coding for embedded applications
.
Memory model
Generic processor 
option
Default memory 
attribute
Default data
pointer
Max. stack size
Tiny
-v0
, -v1, -v2,
-v3
, -v5
_ _tiny
_ _tiny
≤ 256 bytes
Small
-v1
, -v3, -v4,
-v5
, -v6
_ _near
_ _near
≤ 64 Kbytes
Large
-v4
, -v6
_ _far
_ _far
≤ 16 Mbytes
Table 4: Summary of memory models