-
Enhancement
-
Resolution: Unresolved
-
Low
-
Code Generation Tools
-
CODEGEN-11656
-
C6000_8.3.12
-
default
The core part of the floating point divide routine is in the RTS source file divf_i.h. It contains these lines ...
#ifndef Support_DENORM /*Checking if exponent == EMIN - 1, which if denormals are not supported *means checking if x is zero, if it is then return zero */ if(real_x.exp == (uint32_t)(REAL_EMIN - 1)){ quotient.mantissa = 0; quotient.exp = (uint32_t) -REAL_EXP_BIAS; quotient.sign = real_x.sign ^ real_y.sign; REALNUM_TO_REAL(quotient, left); return left; } #else #error This division routine does not support denormalized numbers #endif
The code checks whether the dividend (the first number) is 0. If so, 0 of the correct sign is returned.
The customer requests the addition of similar handling for the divisor (the second number). This is the code suggested:
/*Checking if exponent == EMIN - 1, which if denormals are not supported *means checking if y is zero, if it is then return INF */ if(real_y.exp == (uint32_t)(REAL_EMIN - 1)){ quotient.exp = REAL_EMAX + 1; quotient.mantissa = REAL_FIXED_POINT_ONE; quotient.sign = real_x.sign ^ real_y.sign; REALNUM_TO_REAL(quotient, left); return left; }