Intel ARCHITECTURE IA-32 User Manual Page 381

  • Download
  • Add to my manuals
  • Print
  • Page
    / 636
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 380
Vol. 3A 9-7
PROCESSOR MANAGEMENT AND INITIALIZATION
The EM flag determines whether floating-point instructions are executed by the x87 FPU (EM
is cleared) or a device-not-available exception (#NM) is generated for all floating-point instruc-
tions so that an exception handler can emulate the floating-point operation (EM = 1). Ordinarily,
the EM flag is cleared when an x87 FPU or math coprocessor is present and set if they are not
present. If the EM flag is set and no x87 FPU, math coprocessor, or floating-point emulator is
present, the processor will hang when a floating-point instruction is executed.
The MP flag determines whether WAIT/FWAIT instructions react to the setting of the TS flag.
If the MP flag is clear, WAIT/FWAIT instructions ignore the setting of the TS flag; if the MP
flag is set, they will generate a device-not-available exception (#NM) if the TS flag is set. Gener-
ally, the MP flag should be set for processors with an integrated x87 FPU and clear for proces-
sors without an integrated x87 FPU and without a math coprocessor present. However, an
operating system can choose to save the floating-point context at every context switch, in which
case there would be no need to set the MP bit.
Table 2-1 shows the actions taken for floating-point and WAIT/FWAIT instructions based on the
settings of the EM, MP, and TS flags.
The NE flag determines whether unmasked floating-point exceptions are handled by generating
a floating-point error exception internally (NE is set, native mode) or through an external inter-
rupt (NE is cleared). In systems where an external interrupt controller is used to invoke numeric
exception handlers (such as MS-DOS-based systems), the NE bit should be cleared.
9.2.2 Setting the Processor for x87 FPU Software Emulation
Setting the EM flag causes the processor to generate a device-not-available exception (#NM)
and trap to a software exception handler whenever it encounters a floating-point instruction.
(Table 9-2 shows when it is appropriate to use this flag.) Setting this flag has two functions:
It allows x87 FPU code to run on an IA-32 processor that has neither an integrated x87
FPU nor is connected to an external math coprocessor, by using a floating-point emulator.
It allows floating-point code to be executed using a special or nonstandard floating-point
emulator, selected for a particular application, regardless of whether an x87 FPU or math
coprocessor is present.
Table 9-2. Recommended Settings of EM and MP Flags on IA-32 Processors
EM MP NE IA-32 processor
1 0 1 Intel486™ SX, Intel386™ DX, and Intel386™ SX processors
only, without the presence of a math coprocessor.
0 1 1 or 0
*
Pentium 4, Intel Xeon, P6 family, Pentium, Intel486™ DX, and
Intel 487 SX processors, and Intel386 DX and Intel386 SX
processors when a companion math coprocessor is present.
NOTE:
* The setting of the NE flag depends on the operating system being used.
Page view 380
1 2 ... 376 377 378 379 380 381 382 383 384 385 386 ... 635 636

Comments to this Manuals

No comments