DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

fp(HW)


fp -- floating-point hardware and emulators

Description

The 80387 is the Intel math coprocessor for the 80386. It provides support for arithmetical, trigonometric, exponential, and logarithmic floating-point calculations. Math coprocessors are also available from other manufacturers. The 80486 DX and Pentium(TM) processors include floating-point capability on the chip itself and do not require an external coprocessor.

The kernel tests for the presence of floating-point hardware at startup. If your system has an 80387, you may have to set a switch on the main system board to enable 80387 interrupts. Check your hardware manual to determine the proper switch setting.

If your system does not have an 80387, or it has not been configured to use it, the kernel loads the floating-point emulator code in the file /etc/emulator at boot time.

There are two emulators available:


/etc/emulator.att
emulates an 80387; this is linked to /etc/emulator by default

/etc/emulator.ms
emulates an 8087/287
The C compiler available with the Development System generates the appropriate 80387 opcodes. In particular, the standard math library routines execute up to 200 times faster on a floating-point coprocessor than in emulator code.

The overflow, division by zero, and invalid operand exceptions return a SIGFPE signal that can be caught. The rest of the 80387 floating-point exceptions (underflow, denormalized operand, and precision error) are masked.

Diagnostics

The following error message may be displayed on the console for the Weitek math coprocessor. See messages(M) for general information about kernel error messages, including a list of generic device driver errors.

WARNING: weitek: Unexpected interrupt level, no floating point process

Warning

Floating-point hardware from different manufacturers and the emulators may produce results that differ in the least significant bit(s). You should use the appropriate numerical techniques to handle rounding, truncation, and conversion when performing calculations that involve floating point numbers.

Limitations

The default 80387 emulator is slower than the 8087/287 emulator.

The 8087/287 emulator returns meaningless information on divide by zero.

The 80387 chip implements the final version of the IEEE 754 floating-point standard. Mathematical software compiled to run on the 8087/287 may behave differently with regard to exception handling when run on an 80387.

There is no obvious way to tell which 80387 exception generated the SIGFPE.

Because of design defects in Intel's 80386 chip (B1 stepping), the Intel 80387 math coprocessor may not operate correctly in some computers. The problem causes the CPU to hang when DMA, paging, or coprocessor accesses are occurring. A workaround for this problem has been engineered that is engaged by using a special string at boot time:

   Boot
   : unix a31
This workaround may not work on all machines; some hardware is designed such that it will not work. If it is successful, the following message is displayed:
   A31 CPU bug workaround in effect
If unsuccessful, the following is displayed:
   A31 CPU bug workaround not possible for this machine
The bootstring may also be added to the end of the default bootstring (DEFBOOTSTR) found in /etc/default/boot.

If you cannot use this workaround, you have two options. You may replace the 386 chip with a newer release of the 386 chip (a D-step part), or you can bypass the 387 chip by adding the ignorefpu keyword in your boot command as follows:

   Boot
   : unix ignorefpu
This means that the operating system will not use the 387 chip, but you need not remove it physically; the coprocessor is still usable from DOS. To automatically bypass the 387 chip every time you boot your system, add the ignorefpu keyword to the /etc/default/boot file. See boot(HW) for more information.

Files


/etc/default/boot
default bootstring

/etc/emulator
software math coprocessor emulation

/etc/emulator.att
80387 emulator; linked to /etc/emulator by default

/etc/emulator.ms
8087/287 emulator

See also

boot(HW)

Intel 80387 Programmer's Reference Manual


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003