Processor Feature Selection Options - 2024.1 English

Vitis Unified Software Platform Documentation: Embedded Software Development (UG1400)

Document ID
UG1400
Release Date
2024-05-30
Version
2024.1 English
-mcpu=vX.YY.Z
This option directs the compiler to generate code suited to MicroBlaze hardware version v.X.YY.Z. To get the most optimized and correct code for a given processor, use this switch with the hardware version of the processor.

The -mcpu switch behaves differently for different versions, as described below:

Pr-v3.00.a
Uses 3-stage processor pipeline mode. Does not inhibit exception causing instructions being moved into delay slots.
v3.00.a and v4.00.a
Uses 3-stage processor pipeline model. Inhibits exception causing instructions from being moved into delay slots.
v5.00.a and later
Uses 5-stage processor pipeline model. Does not inhibit exception causing instructions from being moved into delay slots.
-mlittle-endian/-mbig-endian
Use these options to select the endianness of the target machine for which code is being compiled. The endianness of the binary object file produced is also set appropriately based on this switch. The GCC driver passes switches to the sub tools (as, cc1, cc1plus, ld) to set the corresponding endianness in the sub tool.

The default is -mbig-endian.

You cannot link together object files of mixed endianness.

-mno-xl-soft-mul
This option permits use of hardware multiply instructions for 32-bit multiplications. The MicroBlaze processor has an option to turn the use of hardware multiplier resources on or off. This option should be used when the hardware multiplier option is enabled on the MicroBlaze processor. Using the hardware multiplier can improve the performance of your application. The compiler automatically defines the C pre-processor definition HAVE_HW_MUL when this switch is used. This allows you to write C or assembly code tailored to the hardware, based on whether this feature is specified as available or not.
-mxl-multiply-high
The MicroBlaze processor has an option to enable instructions that can compute the higher 32bits of a 32x32-bit multiplication. This option tells the compiler to use these multiply high instructions. The compiler automatically defines the C pre-processor definition HAVE_HW_MUL_HIGH when this switch is used. This allows you to write C or assembly code tailored to the hardware, based on whether this feature is available or not.
-mno-xl-multiply-high
Do not use multiply high instructions. This option is the default.
-mxl-soft-mul
This option tells the compiler that there is no hardware multiplier unit on the MicroBlaze processor, so every 32-bit multiply operation is replaced by a call to the software emulation routine__mulsi3. This option is the default.
-mno-xl-soft-div
You can instantiate a hardware divide unit in MicroBlaze. When the divide unit is present, this option tells the compiler that hardware divide instructions can be used in the program being compiled.

This option can improve the performance of your program if it has a significant amount of division operations. The compiler automatically defines the C pre-processor definition HAVE_HW_DIV when this switch is used. This allows you to write C or assembly code tailored to the hardware, based on whether this feature is specified as available or not.

-mxl-soft-div
This option tells the compiler that there is no hardware divide unit on the target MicroBlaze hardware.

This option is the default. The compiler replaces all 32-bit divisions with a call to the corresponding software emulation routines (__divsi3, __udivsi3).

-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 assumes that no barrel shifter is present, and the compiler uses add and multiply operations to shift the operands. Enabling barrel shifts can speed up your application significantly, especially while using a floating point library. The compiler automatically defines the C pre-processor definition HAVE_HW_BSHIFT when this switch is used. This allows you to write C or assembly code tailored to the hardware, based on whether or not this feature is specified as available.

-mno-xl-barrel-shift
This option tells the compiler not to use hardware barrel shift instructions. This option is the default.
-mxl-pattern-compare
This option activates the use of pattern compare instructions in the compiler.

Using pattern compare instructions can speed up boolean operations in your program. Pattern compare operations also permit operating on word-length data as opposed to byte-length data on string manipulation routines such as strcpy, strlen, and strcmp. On a program heavily dependent on string manipulation routines, the speed increase obtained will be significant. The compiler automatically defines the C pre-processor definition HAVE_HW_PCMP when this switch is used. This allows you to write C or assembly code tailored to the hardware, based on whether this feature is specified as available or not.

-mno-xl-pattern-compare
This option tells the compiler not to use pattern compare instructions. This is the default.
-mhard-float
This option turns on the usage of single precision floating point instructions (fadd, frsub, fmul, and fdiv) in the compiler.

It also uses fcmp.p instructions, where p is a predicate condition such as le, ge, lt, gt, eq, ne. These instructions are natively decoded and executed by MicroBlaze, when the FPU is enabled in hardware. The compiler automatically defines the C pre-processor definition HAVE_HW_FPU when this switch is used. This allows you to write C or assembly code tailored to the hardware, based on whether this feature is specified as available or not.

-msoft-float
This option tells the compiler to use software emulation for floating point arithmetic. This option is the default.
-mxl-float-convert
This option turns on the usage of single precision floating point conversion instructions (fint and flt) in the compiler. These instructions are natively decoded and executed by MicroBlaze, when the FPU is enabled in hardware and these optional instructions are enabled.
-mxl-float-sqrt
This option turns on the usage of single precision floating point square root instructions (fsqrt) in the compiler. These instructions are natively decoded and executed by MicroBlaze, when the FPU is enabled in hardware and these optional instructions are enabled.