80
MicroBlaze Processor Reference Guide
UG081 (v14.7)
Chapter 2:
MicroBlaze Architecture
For practical purposes only 3 and 5 are useful, while the others all represent either an error or
numbers that can no longer be represented with full precision in a 32 bit format.
Rounding
The MicroBlaze FPU only implements the default rounding mode, “Round-to-nearest”, specified in
IEEE 754. By definition, the result of any floating point operation should return the nearest single
precision value to the infinitely precise result. If the two nearest representable values are equally
near, then the one with its least significant bit zero is returned.
Operations
All MicroBlaze FPU operations use the processors general purpose registers rather than a dedicated
floating point register file, see
.
Arithmetic
The FPU implements the following floating point operations:
•
addition, fadd
•
subtraction, fsub
•
multiplication, fmul
•
division, fdiv
•
square root, fsqrt (available if
C_USE_FPU = 2, EXTENDED
)
Comparison
The FPU implements the following floating point comparisons:
•
compare less-than, fcmp.lt
•
compare equal, fcmp.eq
•
compare less-or-equal, fcmp.le
•
compare greater-than, fcmp.gt
•
compare not-equal, fcmp.ne
•
compare greater-or-equal, fcmp.ge
•
compare unordered, fcmp.un (used for NaN)
Conversion
The FPU implements the following conversions (available if
C_USE_FPU = 2, EXTENDED
):
•
convert from signed integer to floating point, flt
•
convert from floating point to signed integer, fint
Exceptions
The floating point unit uses the regular hardware exception mechanism in MicroBlaze. When
enabled, exceptions are thrown for all the IEEE standard conditions: underflow, overflow, divide-
by-zero, and illegal operation, as well as for the MicroBlaze specific exception: denormalized
operand error.
A floating point exception inhibits the write to the destination register (Rd). This allows a floating
point exception handler to operate on the uncorrupted register file.