-
-msmall-divides - This option generates code optimized for small divides when no hardware divider exists. For signed integer divisions where the numerator and denominator are between 0 and 15 inclusive, this switch provides very fast table-lookup-based divisions. When you enable the hardware divider, this switch has no effect.
-
-mxl-gp-opt - If your program contains addresses that have non-zero bits in the most
significant half (top 16 bits), load and store operations require two
instructions.
The MicroBlaze processor ABI offers two global small data areas that can each contain up to 64 KB of data. You can access any memory location within these areas using the small data area anchors and a 16-bit immediate value. This means they only need one instruction for a load or store to the small data area. This optimization can be turned on with the
-mxl-gp-optcommand line parameter. You can store variables smaller than a threshold value in these areas. You can address the variables with fewer instructions. Vitis calculates the addresses during the linking stage.Important: When using this option, provide it to both the compile and the link commands of the build process for your program. Using the switch inconsistently can lead to compile, link, or runtime errors. -
-mno-clearbss - This option is useful for compiling programs used in simulation.
According to the C language standard, uninitialized global variables allocate in the .bss section. The variables have the value 0 when the program starts execution. The C startup files run a loop to fill the .bss section with zero when the program starts execution. For global variables that are zero in C code, optimizing compilers also allocates these to the
.bsssection.In a simulation environment, the above two language features can be unwanted overhead. Some simulators automatically zero the entire memory. Even in a normal environment, you can write C code that does not rely on global variables being zero initially. This switch is useful for these scenarios. It causes the C startup files to not initialize the
.bsssection with zeroes. It also internally forces the compiler to not allocate zero-initialized global variables in the .bss and instead move them to the.datasection. It is possible for this option to improve startup times for your application. Use this option with care, ensuring that one of the following is true:- You do not use code that relies on global variables initialized to zero.
- Your simulation platform performs the zeroing of memory.
-
-mxl-stack-check - With this option, you can check whether the stack overflows when the program
runs.
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 thevariable _stack_overflow_errorto 1.You can override the standard stack overflow handler by providing the function
_stack_overflow_exitin the source code, which acts as the stack overflow handler.