i will try if i can add embedded c projects...
i actually did benchmarks for a atmega328, simulated with the mircochip studio emulator (which is directly build from the cpu-vhdl and should be cycle exact)
the cycle numbers are allways the multiplication and then the assignment to the port, so they are 1 multiplication and 1 conversion to unsigned char:
#include <stdfix.h>
#include <avr/io.h>
int main(void)
{
float a=0.2; // 32 bit foat
accum b=0.2; // 32 bit s15.16 fixed
short accum c=0.2; // 16bit s7.8 fixed
while (1)
{
a=a*a; // start:32
PORTB=a; // end: 205 -> 173 cycles
b=b*b; // start:205
PORTB=b; // 327 -> 122 cycles
c=c*c; // start:327
PORTB=c; // end:399 -> 72 cycles
}
}
i mainy work with mircochip studio, i am a little bit clueless when it comes to the arduino ide.
