This preview shows page 1. Sign up to view the full content.
Unformatted text preview: nd) 2. Looks for, reports on, and handles postcomputation exception conditions (numeric overflow, numeric underflow, and inexact result) If both pre and postcomputational exceptions are unmasked, it is possible for the processor to generate a SIMD floatingpoint exception (#XF) twice during the execution of an SSE, SSE2 or SSE3 instruction: once when it detects and handles a precomputational exception and when it detects a postcomputational exception. 11.5.3.1 Handling Masked Exceptions If all exceptions are masked, the processor handles the exceptions it detects by placing the masked result (or results for packed operands) in a destination operand Vol. 1 1123 PROGRAMMING WITH STREAMING SIMD EXTENSIONS 2 (SSE2) and continuing program execution. The masked result may be a rounded normalized value, signed infinity, a denormal finite number, zero, a QNaN floatingpoint indefinite, or a QNaN depending on the exception condition detected. In most cases, the corresponding exception flag bit in MXCSR is also set. The one situation where an exception flag is not set is when an underflow condition is detected and it is not accompanied by an inexact result. When operating on packed floatingpoint operands, the processor returns a masked result for each of the suboperand computations and sets a separate set of internal exception flags for each computation. It then performs a logicalOR on the internal exception flag settings and sets the exception flags in the MXCSR register according to the results of OR operations. For example, Figure 119 shows the results of an MULPS instruction. In the example, all SIMD floatingpoint exceptions are masked. Assume that a denormal exception condition is detected prior to the multiplication of suboperands X0 and Y0, no exception condition is detected for the multiplication of X1 and Y1, a numeric overflow exception condition is detected for the multiplication of X2 and Y2, and another denormal exception is detected prior to the multiplication of suboperands X3 and Y3. Because denormal exceptions are masked, the processor uses the denormal source values in the multiplications of (X0 and Y0) and of (X3 and Y3) passing the results of the multiplications through to the destination operand. With the denormal operand, the result of the X0 and Y0 computation is a normalized finite value, with no exceptions detected. However, the X3 and Y3 computation produces a tiny and inexact result. This causes the corresponding internal numeric underflow and inexactresult exception flags to be set. X3 X2 X1 X0 (Denormal) Y3 (Denormal) Y2 Y1 Y0 MULPS MULPS MULPS MULPS Tiny, Inexact, Finite Normalized Finite Normalized Finite Figure 119. Example Masked Response for Packed Operations
For the multiplication of X2 and Y2, the processor stores the floatingpoint in the destination operand, and sets the corresponding internal suboperand numeric overflow flag. The result of the X1 and Y1 multiplication is passed through to the destination opera...
View Full
Document
 Winter '11
 Watlins

Click to edit the document details