Some extra care needs to be taken when compiling plugins for the 68881 and 68882 FPUs.
Hollywood's plugin interface was designed to allow plugins compiled for 68881/2 to be
used with the non-FPU version of Hollywood as well. This means that return values from
plugins compiled for 68881/2 must never be stored in FPU registers like fp0
. Instead,
return values must always be returned in CPU registers. If a 64-bit value is to be
returned from a plugin that has been compiled for 68881/2, it must be returned in
registers d0
and d1
, not in fp0
. Even the FPU version of Hollywood will expect
floating point return values in CPU registers. Hollywood will never look for them
in FPU registers! This design makes it possible to use FPU-compiled plugins with the
non-FPU version of Hollywood and also vice versa.
Most compilers, however, will use FPU registers for floating point return values
by default. If you're using vbcc, you can change this behaviour by compiling your
source codes using the -no-fp-return
command line argument. If this is
specified, vbcc will always use CPU registers for return values. If you compile
your sources with -no-fp-return
enabled, however, you'll soon run into
another problem, namely that all the ANSI C runtime library functions which return
floating point values will return them in fp0
. This will cause conflicts because
the compiler expects them in d0
and d1
now. To solve this problem, you will have
to link your project against runtime libraries which also have been compiled using
-no-fp-return
. At the time of this writing, the standard vbcc distribution
does not come with these special libraries, but they're available on request from
Frank Wille, who is the maintainer of the Amiga vbcc distribution.