Processor Feature Selection Options - 2025.2 English - UG1400

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

Document ID
UG1400
Release Date
2025-11-20
Version
2025.2 English
-mcpu=vX.YY.Z
This option directs the compiler to generate code for the MicroBlaze hardware version v.X.YY.Z. To get the 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 a 3-stage processor pipeline mode. Does not inhibit exceptions that move instructions into delay slots.
v3.00.a and v4.00.a
Uses a 3-stage processor pipeline model. Inhibits exception causing instructions from being moved into delay slots.
v5.00.a and later
Uses a 5-stage processor pipeline model. Does not inhibit exception causing instructions moving into delay slots.
-mlittle-endian/-mbig-endian
Use these options to select the endianness of the target machine for the compiling code.
  • The options set the endianness of the binary object file 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.
  • Use this option 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 using this switch. This allows you to write C or assembly code tailored to the hardware.
-mxl-multiply-high
The MicroBlaze processor has an option to enable instructions that can compute the higher 32 bits of a 32x32-bit multiplication.
  • This option tells the compiler to use multiply high instructions.
  • When using this switch, the compiler automatically defines the C pre-processor definition HAVE_HW_MUL_HIGH. This allows you to write C or assembly code tailored to the hardware
-mno-xl-multiply-high
This option tells the compiler to 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. A call replaces every 32-bit mulitply operation 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 it can use hardware divide instructions in the compiling program.
  • This option can improve the performance of your program if it has a significant amount of division operations.
  • When using this switch, the compiler automatically defines the C pre-processor definition HAVE_HW_DIV. This allows you to write C or assembly code tailored to the hardware.
-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
Use this option to configure the barrel shift feature of the MicroBlaze processor.
  • 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 using this switch. This allows you to write C or assembly code tailored to the hardware.
-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. Examples are strcpy, strlen, and strcmp.
  • On a program heavily dependent on string manipulation routines, the speed increase can be significant.
  • The compiler automatically defines the C pre-processor definition HAVE_HW_PCMP when using this script. This allows you to write C or assembly code tailored to the hardware.
-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.
  • This option 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 using this script. This allows you to write C or assembly code tailored to the hardware.
-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. MicroBlaze natively decodes and executes these instructions when the FPU is enabled in hardware and these instructions are enabled.
-mxl-float-sqrt
This option turns on the usage of single precision floating point square root instructions (fsqrt) in the compiler. MicroBlaze natively decodes and executes these instructions when the FPU is enabled in hardware and these instructions are enabled.