Intel 64 and IA-32 Architectures Software Developers Manual Volume 1, Basic Architecture
11-20 Vol. 1
PROGRAMMING WITH STREAMING SIMD EXTENSIONS 2 (SSE2)
11.5.2.1 Invalid Operation Exception (#I)
The floating-point invalid-operation exception (#I) occurs in response to an invalid
arithmetic operand. The flag (IE) and mask (IM) bits for the invalid operation excep-
tion are bits 0 and 7, respectively, in the MXCSR register.
If the invalid-operation exception is masked, the processor returns a QNaN, QNaN
floating-point indefinite, integer indefinite, one of the source operands to the desti-
nation operand, or it sets the EFLAGS, depending on the operation being performed.
When a value is returned to the destination operand, it overwrites the destination
register specified by the instruction. Table 11-1 lists the invalid-arithmetic opera-
tions that the processor detects for instructions and the masked responses to these
operations.
Table 11-1. Masked Responses of SSE/SSE2/SSE3 Instructions to Invalid Arithmetic
Operations
Condition Masked Response
ADDPS, ADDSS, ADDPD, ADDSD, SUBPS, SUBSS,
SUBPD, SUBSD, MULPS, MULSS, MULPD,
MULSD, DIVPS, DIVSS, DIVPD, DIVSD,
ADDSUBPD, ADDSUBPD, HADDPD, HADDPS,
HSUBPD or HSUBPS instruction with an SNaN
operand
Return the SNaN converted to a QNaN; Refer to
Table 4-7 for more details
SQRTPS, SQRTSS, SQRTPD, or SQRTSD with
SNaN operands
Return the SNaN converted to a QNaN
SQRTPS, SQRTSS, SQRTPD, or SQRTSD with
negative operands (except zero)
Return the QNaN floating-point Indefinite
MAXPS, MAXSS, MAXPD, MAXSD, MINPS,
MINSS, MINPD, or MINSD instruction with QNaN
or SNaN operands
Return the source 2 operand value
CMPPS, CMPSS, CMPPD or CMPSD instruction
with QNaN or SNaN operands
Return a mask of all 0s (except for the
predicates “not-equal,” “unordered,” “not-less-
than,” or “not-less-than-or-equal,” which returns
a mask of all 1s)
CVTPD2PS, CVTSD2SS, CVTPS2PD, CVTSS2SD
with SNaN operands
Return the SNaN converted to a QNaN
COMISS or COMISD with QNaN or SNaN
operand(s)
Set EFLAGS values to “not comparable”
Addition of opposite signed infinities or
subtraction of like-signed infinities
Return the QNaN floating-point Indefinite
Multiplication of infinity by zero Return the QNaN floating-point Indefinite
Divide of (0/0) or (
∞ / ∞ ) Return the QNaN floating-point Indefinite