[light] Use reciprocal multiply in normalize_color

Replace 3 software float divides (__divsf3) with 1 divide + 3 native
mul.s instructions. Xtensa has no FPU divide, so __divsf3 is a ~20-30
cycle software routine. This saves ~40-60 cycles per normalize_color
call for +8 bytes of flash.
This commit is contained in:
J. Nick Koston
2026-04-02 13:36:48 -10:00
parent 710186998b
commit 4981b3c671
@@ -104,9 +104,10 @@ class LightColorValues {
this->green_ = 1.0f;
this->blue_ = 1.0f;
} else {
this->red_ /= max_value;
this->green_ /= max_value;
this->blue_ /= max_value;
float inv = 1.0f / max_value;
this->red_ *= inv;
this->green_ *= inv;
this->blue_ *= inv;
}
}
}