Commit 772df1a
rp2: Build with -fno-math-errno to use the hardware sqrt instruction.
Without -fno-math-errno the compiler must keep sqrt()/sqrtf() as library
calls so they can set errno on a domain error, even though the Cortex-M33
FPU has a single VSQRT.F32 instruction. MicroPython's math module
detects domain errors via isnan/isinf checks on the result rather than
errno, so disabling errno here is safe and lets sqrt leverage hardware.
Benchmarked on a Pico 2 (RP2350, perfbench N=150 M=100, avg of 3):
misc_mandel (complex abs() in its inner loop) improves by ~12%, with no
measurable change to non-sqrt benchmarks and a slightly smaller binary.
Signed-off-by: Phil Howard <github@gadgetoid.com>1 parent ca209fd commit 772df1a
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
535 | 540 | | |
536 | 541 | | |
537 | 542 | | |
| |||
0 commit comments