ia-32_instruction-set-ref_a-m

Gp and page fault pf exceptions when they both occur

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ero-divide (#Z) exception. If the divide-by-zero exception is masked and register ST(0) contains 0, the instruction returns with a sign that is the opposite of the sign of the source operand in register ST(1). The FYL2X instruction is designed with a built-in multiplication to optimize the calculation of logarithms with an arbitrary positive base (b): logbx (log2b)1 log2x This instruction's operation is the same in non-64-bit modes and 64-bit mode. 3-428 Vol. 2 INSTRUCTION SET REFERENCE, A-M Operation ST(1) ST(1) log2ST(0); PopRegisterStack; FPU Flags Affected C1 C0, C2, C3 Set to 0 if stack underflow occurred. Set if result was rounded up; cleared otherwise. Undefined. Floating-Point Exceptions #IS #IA Stack underflow occurred. Either operand is an SNaN or unsupported format. Source operand in register ST(0) is a negative finite value (not -0). #Z #D #U #O #P Source operand in register ST(0) is 0. Source operand is a denormal value. Result is too small for destination format. Result is too large for destination format. Value cannot be represented exactly in destination format. Protected Mode Exceptions #NM #MF CR0.EM[bit 2] or CR0.TS[bit 3] = 1. If there is a pending x87 FPU exception. Real-Address Mode Exceptions Same exceptions as in Protected Mode. Virtual-8086 Mode Exceptions Same exceptions as in Protected Mode. Compatibility Mode Exceptions Same exceptions as in Protected Mode. 64-Bit Mode Exceptions Same exceptions as in Protected Mode. Vol. 2 3-429 INSTRUCTION SET REFERENCE, A-M FYL2XP1--Compute y log2(x +1) Opcode D9 F9 Instruction FYL2XP1 64-Bit Mode Valid Compat/ Leg Mode Valid Description Replace ST(1) with ST(1) log2(ST(0) + 1.0) and pop the register stack. Description Computes (ST(1) log2(ST(0) + 1.0)), stores the result in register ST(1), and pops the FPU register stack. The source operand in ST(0) must be in the range: ( 1 2 / 2 ) )to ( 1 2 / 2 ) The source operand in ST(1) can range from - to +. If the ST(0) operand is outside of its acceptable range, the result is undefined and software should not rely on an exception being generated. Under some circumstances exceptions may be generated when ST(0) is out of range, but this behavior is implementation specific and not guaranteed. The following table shows the results obtained when taking the log epsilon of various classes of numbers, assuming that underflow does not occur. Table 3-54. FYL2XP1 Results ST(0) -(1 - ( 2 / 2 )) to -0 - + -0 * +0 +0 -0 -0 * NaN +0 * -0 -0 +0 +0 * NaN +0 to +(1 - ( 2 / 2 )) - NaN NaN NaN NaN NaN NaN NaN NaN ST(1) -F -0 +0 +F + NaN +F +0 -0 -F - -F -0 +0 +F + NaN NaN NOTES: F Means finite floating-point value. * Indicates floating-point invalid-operation (#IA) exception. This instruction provides optimal accuracy for values of epsilon [the value in register ST(0)] that are close to 0. For small epsilon () values, more significant digits can be retained by using the FYL2XP1 instruction than by using (+1) as an argument to the FYL2X instruction. The (+1) e...
View Full Document

This note was uploaded on 10/01/2013 for the course CPE 103 taught by Professor Watlins during the Winter '11 term at Mississippi State.

Ask a homework question - tutors are online