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.

c28x FPU vs CLA

Hi,

a = -1243.0 (0xC49B6000)

b = 1.4463812e-4 (0x3917AA00)

CLA result c=a*b = -0.1797852(0xBE38199B)

c28x FPU result c=a*b = -0.1797852(0xBE38199C)

How to explain the difference results of  CLA and FPU in hex format?

Which one is better accuracy ?

thanks,

Simen

  • I dont think rounding is turned on in the CLA by default. If you look at the CLA chapter in the TRM, the MSTF register bit 9 :

    0h (R/W) = If this bit is zero, the MMPYF32, MADDF32 and

    MSUBF32 instructions will round to zero (truncate).

    1h (R/W) = If this bit is one, the MMPYF32, MADDF32 and

    MSUBF32 instructions will round to the nearest even value.

     

    I believe if you were to turn on RNDF32 on the CLA, or alternatively, turn off RNDF32 for the FPU you would end up with the same answer.

    You can set the RNDF32 flag on the CLA and then try the operations

    __meallow()

    __asm(" MSETFLAG RNDF32=1") 

    __medis()

  • Vishal,

    Thank you. it works.

    __asm(" MSETFLAG RNDF32=1")

    ==>

    __asm(" MSETFLG RNDF32=1") ;

    best regards,

    Simen

  • Hi,

    why do I need meallow and medis? The MSTF register is not EALLOW protected!?

    Best regards

    Gennadi

  • Yep, you are right it isnt meallow protected, my mistake. You should be able to read/write to it without the meallow/medis.