Skip to main content
ivan239955_stm1_stmicro_com
Associate III
April 21, 2010
Question

Duration of FLOAT operations

  • April 21, 2010
  • 12 replies
  • 3565 views
Posted on April 21, 2010 at 20:34

Duration of FLOAT operations

#stm32 #stm32
    This topic has been closed for replies.

    12 replies

    anders239955
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 13:48

    It is a huge difference between EWARM 5.20 and EWARM 5.50 regarding timing of floating point operations. One may get worse performance if the wrong functions are replaced by the corresponding functions in the GoFast library. Please read the attached document.

    anders239955
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 13:48

    The floating point library is written so that the code is normally executed straight forward without branches taken. As we do not have any specific benchmarks regarding code running from flash, I can only give you the idealistic cycle timings for the functions (if I remember the timings right):

    Add/Sub    33-43 cycles

    Mul            36 cycles

    Div            49-58 cycles

    There might be some cycles less as I have made some changes/optimizations since I measured the timings, but I think this will give you a hint about the timings of the 32-bit floating point operations in the EWARM.

    We have also rewritten a bunch of the standard C math functions in version 5.50 of EWARM in order to speed up things a bit further.

    Does anybody know how long the float adding/multiplication/division lasts in STM32 code compiled by EWARM and running from flash?

    Regards

    Ivan