Specifications

Embedded System Tools Guide (EDK 6.2i) www.xilinx.com 173
UG111 (v1.4) January 30, 2004 1-800-255-7778
MicroBlaze GNU Compiler
R
multiplier gives better performance, but can be done only on devices with hardware
multiplier such as Virtex II.
-mxl-soft-div
The MicroBlaze processor does not come with a hardware divide unit. The users would
need the software routine in the libraries for the divide operation. This option is turned on
by default in mb-gcc.
-mno-xl-soft-div
In MicroBlaze version 2.00 and beyond, the user can instantiate a hardware divide unit in
MicroBlaze. If such a unit is present, this option should be provided to mb-gcc compiler.
Refer to the MicroBlaze Reference Guide for more details about the usage of hardware
divide option in the MicroBlaze.
-mxl-stack-check
This option lets users check if the stack overflows during the execution of the program. The
compiler inserts code in the prologue of the every function, comparing the stack pointer
value with the available memory. If the stack pointer exceeds the available free memory,
the program jumps to a the subroutine _stack_overflow_exit. This subroutine sets
the value of the variable _stack_overflow_error to 1.
The standard stack overflow handler can be overridden by providing the function
_stack_overflow_exit in the source code, which acts as the stack overflow handler.
-mxl-barrel-shift
The MicroBlaze processor can be configured to be built with a barrel shifter. In order to use
the barrel shift feature of the processor, use the option -mxl-barrel-shift. The default
option is to assume that no barrel shifter is present and hence the compiler will use add
and multiply operations to shift the operands. Barrel shift can increase the speed
significantly, especially while doing floating point operations.Refer to the MicroBlaze
Reference Guide for more details about the usage of the barrel shifter option in the
MicroBlaze.
-mxl-gp-opt
If the memory location requires more than 32K, the load/store operation requires two
instructions. MicroBlaze ABI offers two global small data areas, which can contain up to
64K bytes of data each. Any memory location within these areas can be accessed using the
small data area anchors and a 16-bit immediate value. Hence needing only one instruction
for load/store to the small data area.This optimization can be turned ON with the -mxl-gp-
opt command line parameter. Variables of size lesser than a certain threshold value are
stored in these areas. The value of the pointers is determined during linking.
-xl-mode-executable
This is the default mode used for compiling programs with mb-gcc. The final executable
created starts from address location 0x0 and links in crt0.o. This option need not be
provided on the command line for mb-gcc.