INF: Applications and the Math Coprocessor Under Windows

ID Number: Q43276

1.03 1.04 2.03 2.10 3.00 3.10

WINDOWS

Summary:

When an application for Microsoft Windows is run on a machine with a

math coprocessor, the application can use inline floating-point

instructions to take the fullest advantage of the hardware.

More Information:

Specifying the -FPi option on the C compiler command line causes the

Microsoft C optimizing compiler to produce inline 80x87 math

coprocessor code for any floating-point math operation. If this code

is linked with the WIN87EM.LIB library and a math coprocessor is

present in the system at run time, the application will use the inline

floating-point instructions for its math operations. If no coprocessor

is available at run time, code in the emulator library evaluates

floating-point expressions.

An application compiled for the MS-DOS environment with the -FPi

option checks for the coprocessor at run time and modifies its code

accordingly: if there is a coprocessor, it uses inline floating-point

instructions; if there is no coprocessor, it calls software routines

to emulate the coprocessor.

In the Windows environment, these run-time modifications are not

performed because the Windows kernel fixes up the floating point

references as it loads the application's code segments (the kernel is

aware of the presence or absence of the numeric coprocessor). This

means that an application for the Windows environment compiled with

the -FPi option will perform direct, inline floating-point

instructions without run-time coprocessor-checking. Consequently,

there is no need to link in the Microsoft C Compiler inline floating-

point module, which removes the run-time coprocessor-checking.

Additional reference words: 1.03 1.04 2.03 2.10 3.00 3.10 1.x 2.x