Rewrite .fif8 to avoid powerpc64 fctid
authorGeorge Koehler <xkernigh@netscape.net>
Mon, 17 Oct 2016 04:39:59 +0000 (00:39 -0400)
committerGeorge Koehler <xkernigh@netscape.net>
Mon, 17 Oct 2016 04:39:59 +0000 (00:39 -0400)
commitf33b30ed3c185bd784b595ec2cc4d1ce8b29d897
tree1aa47bef91a3105da7a724086928fd4d40d3b66f
parente2ccc8f94237d836a87dec274dfc06b406c8bfb3
Rewrite .fif8 to avoid powerpc64 fctid

This fixes the SIGILL (illegal instruction) in startrek when firing
phasers.  The 32-bit processors in my PowerPC Mac and in QEMU don't
have fctid, a 64-bit instruction.

I got the idea from mach/proto/fp/fif8.c to extract the exponent,
clear some bits to get an integer, then subtract the integer from
the original value to get the fraction.
mach/powerpc/libem/fif8.s
mach/powerpc/ncg/table