From 422fdb134aba662ec9c29b7227915cc0ae3956f8 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Sun, 27 Oct 2024 19:02:05 +0100 Subject: [PATCH] usre faster math for _S builds similar to -ffast-math, but still supports NaN and infinites (needed for sunrise/sunset calculations) 10%-20% faster on -S3 --- platformio.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 367b85cb..9cc3b3d7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1270,7 +1270,9 @@ build_flags = build_flags = -O2 ;; optimize for performance instead of size ;-ffast-math ;; gives a few (2-5) percent speedup on ESP32-S3, but causes slight slowdown on classic ESP32 - -mtarget-align -free -fipa-pta ;; these are very useful, too + -funsafe-math-optimizations -fsingle-precision-constant ;; less dangerous than -ffast-math; still allows the compiler to exploit FMA and reciprocals (10% faster on -S3) + ;; -mtarget-align ;; this one is included in -O2, so its not necessary to explicitly add it + -free -fipa-pta ;; these are very useful, too -fno-jump-tables -fno-tree-switch-conversion ;; needed -freorder-blocks -Wwrite-strings -fstrict-volatile-bitfields ;; needed build_unflags =