This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280049C: How do I test a float32_t on the CLA for denormal values after calculations (DEN)?

Part Number: TMS320F280049C

Tool/software:

I occasionally get denormalized values after some calculations and I am trying to determine whether it affects later calculations or not and also how to test for these values.

In all cases, I am using float32_t with the relaxed floating point option on.

For example, if x is a float32_t and is DEN, what happens on the CLA if you take the sin(x)?  Does it consider x to be 0?  Does it fail or generate exception flags or interrupts in any way?

How do I test x to see if it is denormalized?  On the C28x, I would use the following code, but fpclassify() (found in math.h) isn't implemented for the CLA in CLA_math.h.

    if (fpclassify(x) == FP_SUBNORMAL)
    {
        x = 0.0f;
    }

  • On the C28x FPU and CLA there are some simplifications from the IEEE-754 standard

    Simplifications to the IEEE-754 format (true for the FPU and CLA)
    Flags & compare operations:

    • Negative zero is treated as positive zero
    • Denormalized values are treated as zero
    • Not-a-number (NaN) is treated as infinity

    You may also find this post helpful: