On Tue, 4 Mar 2025, Michael Schmitz wrote:
However, almost all trigonometric functions are not implemented...
What sense does it then make to use an emulation, when only basic
instructions like fadd/fmul etc. are implemented?
A good way to answer that question is to disable it and see what breaks
(assuming you have suitable hardware available).
Programs are not even aborted when using one of those functions,
uprint just prints an error message, and the functions just return
with their input arguments as result instead of calculating the
expected value.
As I recall it, the main purpose was to keep kernel and a few important
system utilities from blowing up on 030 machines with no FPU. User space
programs that need to use trig functions or other FPU implemented
functions can be compiled with -m soft_float (or something along those
lines) on those systems.
Back in 2019, when I needed to get 'fio' to work on a 680x0 system with no
FPU, I had to make a few small changes to the program to avoid floating
point logarithms. That was sufficient to get it to work. The FPU emulator
took care of the rest.