Files
lk/app
Travis Geiselbrecht 9c67917dd7 [fpu] Implement two versions of all of the printf routines: with and without fpu support
The default printf and family will now not implement FPU support, a
second copy of the routines will be generated with the _float suffix.

ie, printf() has no %f support, but printf_float() does.

This is to avoid the default printf from emitting any floating point
instructions when used within core kernel code which has been an off and
on problem for years, especially on architectures that are eager to use
fpu/vector instructions for regular non-fpu code.

If FPU is not implemented on the arch, the *_float routines will alias
to the integer only one.

Perhaps a much more proper solution is to invert this and require every
caller of printf that cannot tolerate fpu codegen (which in mainline is
most of it) use a _nofloat implementation, but this would touch
pratically all printfs in mainline.

This solution acknowledges that for the most part most of the code in
mainline is in-kernel support code, and doesn't need floating point,
except for perhaps some app/* code, which already can opt in.

This solution also can potentially bloat the size of the binary by
having two complete implementations, though I think in practice the
architectures where the extra few KB of code will matter generally dont
have FPU support, or aren't using it. In the latter case the
link-time-gc should remove unused _float routines.
2025-10-08 23:51:06 -07:00
..
2023-04-23 17:23:31 -07:00