FPU on the UNIX pc

Michael "Ford" Ditto ditto at cbmvax.UUCP
Tue Oct 25 01:37:27 AEST 1988


In article <528 at icus.islp.ny.us> lenny at icus.islp.ny.us (Lenny Tropiano) writes:
>	"The C compiler uses one of three code generators for the
>
>		CPU=xxxxx,FPU=yyyyy
>
>	where CPU indicates the central processor to generate for and
>	FPU indicates the style of floating-point math to use.

Since the 881 version of the code generator is a separate executable
(/lib/ccom20.81 used in place of /lib/ccom) and it is not provided with the
Unix PC, it is not possible to generate 68881 code with the standard
compiler.  The stock assembler WILL assemble 68020 and 68881 code, and adb
disassembles it fine as well.

I have a version of GCC modified to use the CENVIRON variable in this way,
and it generates normal Unix PC code or 68020/68881 code (or 68010/68881,
which is what would be needed here).

There is already some kind of support for the "fpa board" in the math
library; various math routines call "FPA_check" or something like that to
see if it's there.  I've never bothered to see what they do differently
when it's there, though.  In particular, I don't know whether 68881 opcodes
are used to cuase an illegal instruction trap in the kernel to access the
'881 or if it is accessed directly (via I/O).

Actually, I don't think the compiler was meant to use 68881 instructions
without a 68020.  Running "CENVIRON=CPU=68010,FPU=68881 cc t.c" results in:
"cc:  incompatiable combination of fpu/cpu in CENVIRON".
-- 
					-=] Ford [=-

"The number of Unix installations	(In Real Life:  Mike Ditto)
has grown to 10, with more expected."	ford at kenobi.cts.com
- The Unix Programmer's Manual,		...!sdcsvax!crash!elgar!ford
  2nd Edition, June, 1972.		ditto at cbmvax.commodore.com



More information about the Comp.sys.att mailing list