Software implementations of integer and floating point arithmetic is available as library routines in libgcc.a for both processors. The compiler for both the processors inserts calls to these routines in the code produced, in case the hardware does not support the arithmetic primitive with an instruction.
Details of the software implementations of integer and floating point arithmetic for MicroBlaze processors are listed below:
By default, integer multiplication is done in software using the library function
__mulsi3. Integer multiplication is done in hardware
-mno-xl-soft-mul mb-gcc option is specified.
Integer divide and mod operations are done in software using the library functions
__modsi3. The MicroBlaze processor can also be
customized to use a hard divider, in which case the
instruction is used in place of the
routine. Double precision multiplication, division and mod functions are carried out by
the library functions
__moddi3 respectively. The
unsigned version of these operations correspond to the signed versions described above,
but are prefixed with an
__u instead of
Floating Point Arithmetic
All floating point addition, subtraction, multiplication, division, and conversions are implemented using software functions in the C library.
The standard C library provided with the Vitis IDE is not
built for a multi-threaded environment. STDIO functions like
scanf() and memory management
free() are common examples of functions that are not thread-safe. When
using the C library in a multi-threaded environment, proper mutual exclusion techniques
must be used to protect thread unsafe functions.