[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## RE: [avr-gcc-list] floating point calculations - How many cycles

**From**: |
Ben Mann |

**Subject**: |
RE: [avr-gcc-list] floating point calculations - How many cycles |

**Date**: |
Sun, 26 Jun 2005 10:53:07 +0800 |

It might be the hard way, but looking at the assembly generated by GCC is a
very good indication (and very educational). The clock cycles per assembly
language instruction is listed in the part's data sheet. A simulator may
further simplify this process and do the calculation for you. Bear in mind
that if any interrupts go off during the calculation, the actual number of
clock cycles to complete is possibly indeterminate.
Ben
-----Original Message-----
Hi,
I know this is a kinda elementary question, but i am not sure how to
calcuate the number of clock cycles on an Atmel 128L (7.3Mhz) would
the following line of code doing floating point multiplication take.
currTime = (uint32_t)(skew_*(double)currTime + offset_);//compensation
over here!!
here the currTime and offset are 32 bit integers, while the skew is a
floating point with value very close to zero (0.999987 therof).
If some one can tell me how to do this clacuation, I would be grateful.
Thank you.
Affan