Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Лаб2012 / 25366517.pdf
Скачиваний:
65
Добавлен:
02.02.2015
Размер:
3.33 Mб
Скачать

APPENDIX C FLOATING-POINT EXCEPTIONS SUMMARY

C.1 OVERVIEW

This appendix shows which of the floating-point exceptions can be generated for:

x87 FPU instructions see Table C-2

SSE instructions see Table C-3

SSE2 instructions see Table C-4

SSE3 instructions see Table C-5

Table C-1 lists types of floating-point exceptions that potentially can be generated by the x87 FPU and by SSE/SSE2/SSE3 instructions.

 

Table C-1. x87 FPU and SIMD Floating-Point Exceptions

Floating-point

 

Exception

Description

#IS

Invalid-operation exception for stack underflow or stack overflow (can only be generated

 

for x87 FPU instructions)*

 

 

#IA or #I

Invalid-operation exception for invalid arithmetic operands and unsupported formats*

 

 

#D

Denormal-operand exception

 

 

#Z

Divide-by-zero exception

 

 

#O

Numeric-overflow exception

 

 

#U

Numeric-underflow exception

 

 

#P

Inexact-result (precision) exception

 

 

Note:

*The x87 FPU instruction set generates two types of invalid-operation exceptions: #IS (stack underflow or stack overflow) and #IA (invalid arithmetic operation due to invalid arithmetic operands or unsupported formats). SSE/SSE2/SSE3 instructions potentially generate #I (invalid operation exceptions due to invalid arithmetic operands or unsupported formats).

The floating point exceptions shown in Table C-1 (except for #D and #IS) are defined in IEEE Standard 754-1985 for Binary Floating-Point Arithmetic. See Section 4.9.1, “Floating-Point Exception Conditions”, for a detailed discussion of floating-point exceptions.

Vol. 1 C-1

FLOATING-POINT EXCEPTIONS SUMMARY

C.2 X87 FPU INSTRUCTIONS

Table C-2 lists the x87 FPU instructions in alphabetical order. For each instruction, it summarizes the floating-point exceptions that the instruction can generate.

Table C-2. Exceptions Generated with x87 FPU Floating-Point Instructions

Mnemonic

Instruction

#IS

#IA

#D

#Z

#O

#U

#P

 

 

 

 

 

 

 

 

 

F2XM1

Exponential

Y

Y

Y

 

 

Y

Y

 

 

 

 

 

 

 

 

 

FABS

Absolute value

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FADD(P)

Add floating-point

Y

Y

Y

 

Y

Y

Y

 

 

 

 

 

 

 

 

 

FBLD

BCD load

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FBSTP

BCD store and pop

Y

Y

 

 

 

 

Y

 

 

 

 

 

 

 

 

 

FCHS

Change sign

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FCLEX

Clear exceptions

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FCMOVcc

Floating-point conditional

Y

 

 

 

 

 

 

 

move

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FCOM, FCOMP, FCOMPP

Compare floating-point

Y

Y

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

FCOMI, FCOMIP, FUCOMI,

Compare floating-point and set

Y

Y

Y

 

 

 

 

FUCOMIP

EFLAGS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FCOS

Cosine

Y

Y

Y

 

 

 

Y

 

 

 

 

 

 

 

 

 

FDECSTP

Decrement stack pointer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FDIV(R)(P)

Divide floating-point

Y

Y

Y

Y

Y

Y

Y

 

 

 

 

 

 

 

 

 

FFREE

Free register

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FIADD

Integer add

Y

Y

Y

 

Y

Y

Y

 

 

 

 

 

 

 

 

 

FICOM(P)

Integer compare

Y

Y

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

FIDIV

Integer divide

Y

Y

Y

Y

 

Y

Y

 

 

 

 

 

 

 

 

 

FIDIVR

Integer divide reversed

Y

Y

Y

Y

Y

Y

Y

 

 

 

 

 

 

 

 

 

FILD

Integer load

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FIMUL

Integer multiply

Y

Y

Y

 

Y

Y

Y

 

 

 

 

 

 

 

 

 

FINCSTP

Increment stack pointer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FINIT

Initialize processor

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FIST(P)

Integer store

Y

Y

 

 

 

 

Y

 

 

 

 

 

 

 

 

 

FISTTP

Truncate to integer

Y

Y

 

 

 

 

Y

 

(SSE3 instruction)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FISUB(R)

Integer subtract

Y

Y

Y

 

Y

Y

Y

 

 

 

 

 

 

 

 

 

FLD extended or stack

Load floating-point

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FLD single or double

Load floating-point

Y

Y

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

C-2 Vol. 1

 

 

 

 

 

 

 

 

FLOATING-POINT EXCEPTIONS SUMMARY

Table C-2. Exceptions Generated with x87 FPU Floating-Point Instructions (Contd.)

Mnemonic

Instruction

#IS

#IA

#D

#Z

#O

#U

 

#P

 

 

 

 

 

 

 

 

 

 

 

 

FLD1

Load + 1.0

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FLDCW

Load Control word

Y

Y

Y

Y

Y

Y

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FLDENV

Load environment

Y

Y

Y

Y

Y

Y

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FLDL2E

Load log2e

Y

 

 

 

 

 

 

 

 

FLDL2T

Load log210

Y

 

 

 

 

 

 

 

 

FLDLG2

Load log102

Y

 

 

 

 

 

 

 

 

FLDLN2

Load loge2

Y

 

 

 

 

 

 

 

 

FLDPI

Load π

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FLDZ

Load + 0.0

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FMUL(P)

Multiply floating-point

Y

Y

Y

 

Y

Y

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FNOP

No operation

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FPATAN

Partial arctangent

Y

Y

Y

 

 

Y

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FPREM

Partial remainder

Y

Y

Y

 

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FPREM1

IEEE partial remainder

Y

Y

Y

 

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FPTAN

Partial tangent

Y

Y

Y

 

 

Y

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FRNDINT

Round to integer

Y

Y

Y

 

 

 

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FRSTOR

Restore state

Y

Y

Y

Y

Y

Y

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FSAVE

Save state

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FSCALE

Scale

Y

Y

Y

 

Y

Y

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FSIN

Sine

Y

Y

Y

 

 

Y

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FSINCOS

Sine and cosine

Y

Y

Y

 

 

Y

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FSQRT

Square root

Y

Y

Y

 

 

 

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FST(P) stack or extended

Store floating-point

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FST(P) single or double

Store floating-point

Y

Y

 

 

Y

Y

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FSTCW

Store control word

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FSTENV

Store environment

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FSTSW (AX)

Store status word

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FSUB(R)(P)

Subtract floating-point

Y

Y

Y

 

Y

Y

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

FTST

Test

Y

Y

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FUCOM(P)(P)

Unordered compare floating-

Y

Y

Y

 

 

 

 

 

 

 

point

 

 

 

 

 

 

 

 

 

FWAIT

CPU Wait

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FXAM

Examine

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Vol. 1

C-3

FLOATING-POINT EXCEPTIONS SUMMARY

Table C-2. Exceptions Generated with x87 FPU Floating-Point Instructions (Contd.)

Mnemonic

Instruction

#IS

#IA

#D

#Z

#O

#U

#P

 

 

 

 

 

 

 

 

 

FXCH

Exchange registers

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FXTRACT

Extract

Y

Y

Y

Y

 

 

 

 

 

 

 

 

 

 

 

 

FYL2X

Logarithm

Y

Y

Y

Y

Y

Y

Y

 

 

 

 

 

 

 

 

 

FYL2XP1

Logarithm epsilon

Y

Y

Y

 

Y

Y

Y

 

 

 

 

 

 

 

 

 

C.3 SSE INSTRUCTIONS

Table C-3 lists SSE instructions with at least one of the following characteristics:

have floating-point operands

generate floating-point results

read or write floating-point status and control information

The table also summarizes the floating-point exceptions that each instruction can generate.

Table C-3. Exceptions Generated with SSE Instructions

Mnemonic

Instruction

#I

#D

#Z

#O

#U

#P

 

 

 

 

 

 

 

 

ADDPS

Packed add.

Y

Y

 

Y

Y

Y

 

 

 

 

 

 

 

 

ADDSS

Scalar add.

Y

Y

 

Y

Y

Y

 

 

 

 

 

 

 

 

ANDNPS

Packed logical INVERT and

 

 

 

 

 

 

 

AND.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ANDPS

Packed logical AND.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CMPPS

Packed compare.

Y

Y

 

 

 

 

 

 

 

 

 

 

 

 

CMPSS

Scalar compare.

Y

Y

 

 

 

 

 

 

 

 

 

 

 

 

COMISS

Scalar ordered compare lower

Y

Y

 

 

 

 

 

SP FP numbers and set the

 

 

 

 

 

 

 

status flags.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CVTPI2PS

Convert two 32-bit signed

 

 

 

 

 

Y

 

integers from MM2/Mem to two

 

 

 

 

 

 

 

SP FP.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CVTPS2PI

Convert lower two SP FP from

Y

 

 

 

 

Y

 

XMM/Mem to two 32-bit signed

 

 

 

 

 

 

 

integers in MM using rounding

 

 

 

 

 

 

 

specified by MXCSR.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CVTSI2SS

Convert one 32-bit signed

 

 

 

 

 

Y

 

integer from Integer Reg/Mem to

 

 

 

 

 

 

 

one SP FP.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C-4 Vol. 1

FLOATING-POINT EXCEPTIONS SUMMARY

Table C-3. Exceptions Generated with SSE Instructions (Contd.)

Mnemonic

Instruction

#I

#D

#Z

#O

#U

 

#P

 

 

 

 

 

 

 

 

 

CVTSS2SI

Convert one SP FP from

Y

 

 

 

 

 

Y

 

XMM/Mem to one 32-bit signed

 

 

 

 

 

 

 

 

integer using rounding mode

 

 

 

 

 

 

 

 

specified by MXCSR, and move

 

 

 

 

 

 

 

 

the result to an integer register.

 

 

 

 

 

 

 

CVTTPS2PI

Convert two SP FP from

Y

 

 

 

 

 

Y

 

XMM2/Mem to two 32-bit signed

 

 

 

 

 

 

 

 

integers in MM1 using truncate.

 

 

 

 

 

 

 

CVTTSS2SI

Convert lowest SP FP from

Y

 

 

 

 

 

Y

 

XMM/Mem to one 32-bit signed

 

 

 

 

 

 

 

 

integer using truncate, and move

 

 

 

 

 

 

 

 

the result to an integer register.

 

 

 

 

 

 

 

DIVPS

Packed divide.

Y

Y

Y

Y

Y

 

Y

 

 

 

 

 

 

 

 

 

DIVSS

Scalar divide.

Y

Y

Y

Y

Y

 

Y

 

 

 

 

 

 

 

 

 

LDMXCSR

Load control/status word.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MAXPS

Packed maximum.

Y

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MAXSS

Scalar maximum.

Y

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MINPS

Packed minimum.

Y

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MINSS

Scalar minimum.

Y

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MOVAPS

Move four packed SP values.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MOVHLPS

Move packed SP high to low.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MOVHPS

Move two packed SP values

 

 

 

 

 

 

 

 

between memory and the high

 

 

 

 

 

 

 

 

half of an XMM register.

 

 

 

 

 

 

 

MOVLHPS

Move packed SP low to high.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MOVLPS

Move two packed SP values

 

 

 

 

 

 

 

 

between memory and the low

 

 

 

 

 

 

 

 

half of an XMM register.

 

 

 

 

 

 

 

MOVMSKPS

Move sign mask to r32.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MOVSS

Move scalar SP number

 

 

 

 

 

 

 

 

between an XMM register and

 

 

 

 

 

 

 

 

memory or a second XMM

 

 

 

 

 

 

 

 

register.

 

 

 

 

 

 

 

MOVUPS

Move unaligned packed data.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MULPS

Packed multiply.

Y

Y

 

Y

Y

 

Y

 

 

 

 

 

 

 

 

 

MULSS

Scalar multiply.

Y

Y

 

Y

Y

 

Y

 

 

 

 

 

 

 

 

 

ORPS

Packed OR.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RCPPS

Packed reciprocal.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RCPSS

Scalar reciprocal.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Vol. 1

C-5

Соседние файлы в папке Лаб2012