
3-2
C Cross Compiler
3.1 Compiler Options
The CC compiler supports all GCC compiler options in addition to the
SDK-specific options described in
Table 3.1
.
The
-mlong_call
option is frequently necessary with SDCC because
call-immediates on the ZSP400 architecture have a 13-bit range, and its
use is therefore recommended for applications that are larger than the
range of a call-immediate. The ZSPG2 architecture has a larger call
immediate range (16-bits), so this option is not as critical for it. Better
performance and code size can be obtained by selectively using the
-
mlong_call
option, but this may require repetitive trial and error to
determine which files can safely be converted to use call-immediates.
One important exception is a file which does not call a function external
Table 3.1
Compiler Options
Option
Description
Availability
-mlong_call
The compiler generates code for a call instruction using
a register operand. Use this option to resolve the
limitation of the call immediate range.
SDCC
ZDCC
ZDXCC
1
-mno_sdopt
The compiler disables the assembly optimizer,
sdopt
/
zdopt/zdxopt
. By default, the optimizer is
automatically invoked at optimization levels -
O1
, -
O2
and
-
O3
.
SDCC
ZDCC
ZDXCC
-mlong_cond_branch
2
The compiler generates code for a conditional branch by
using a register operand.
SDCC
ZDXCC
-mlong_uncond_branch
3
The compiler generates code for an unconditional
branch by using a register operand.
SDCC
ZDXCC
-minfer_mac
Enable the compiler to generate mac and macn
instructions without using intrinsics. Use this option only
if the code generated will be run with the sat, q15, sre
and mre bits of %fmode turned off.
SDCC
ZDXCC
-mlarge_data
Use large data model.
ZDCC
1. Since the range of a call immediate on ZSPG2 is 16-bits versus 13-bits on ZSP400, the -mlong_call
option will be less frequently needed for ZDXCC and ZDCC.
2. This option is preserved for backward compatibility with previous versions of the SDK, but it is no
longer needed, since the compiler will automatically use register based branches when needed.
This option will be removed in a future version of the SDK.
3. (same as 2.)