according to the datasheet, the ESP32 seems to contain a hardware FPU, but in my tests, I get very bad FPU performance. For example, the following addition of two "float" variables and assignment to a third "float" variable (all 3 declared as volatile so that they don't get optimized away) takes 8.6 microseconds (measured on the GPIO output):
Code: Select all
volatile float f1 = 1.11111111111111111111;
volatile float f2 = 4.44444444444444444444;
volatile float fSum;
...
gpio_set_level(GPIO_NUM_18, 1);
fSum = f1 + f2;
gpio_set_level(GPIO_NUM_18, 0);
Cheers
Andreas