ia-32_instruction-set-ref_a-m

0 fpustatusword15 0 vol 2 3 299 instruction set

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: -301 INSTRUCTION SET REFERENCE, A-M Operation IF condition TRUE THEN ST(0) ST(i); FI; FPU Flags Affected C1 C0, C2, C3 Set to 0 if stack underflow occurred. Undefined. Floating-Point Exceptions #IS Stack underflow occurred. Integer Flags Affected None. Protected Mode Exceptions #NM CR0.EM[bit 2] or CR0.TS[bit 3] = 1. 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. 3-302 Vol. 2 INSTRUCTION SET REFERENCE, A-M FCOM/FCOMP/FCOMPP--Compare Floating Point Values Opcode D8 /2 DC /2 D8 D0+i D8 D1 D8 /3 DC /3 D8 D8+i D8 D9 DE D9 Instruction FCOM m32fp FCOM m64fp FCOM ST(i) FCOM FCOMP m32fp FCOMP m64fp FCOMP ST(i) FCOMP FCOMPP 64-Bit Mode Valid Valid Valid Valid Valid Valid Valid Valid Valid Compat/ Leg Mode Valid Valid Valid Valid Valid Valid Valid Valid Valid Description Compare ST(0) with m32fp. Compare ST(0) with m64fp. Compare ST(0) with ST(i). Compare ST(0) with ST(1). Compare ST(0) with m32fp and pop register stack. Compare ST(0) with m64fp and pop register stack. Compare ST(0) with ST(i) and pop register stack. Compare ST(0) with ST(1) and pop register stack. Compare ST(0) with ST(1) and pop register stack twice. Description Compares the contents of register ST(0) and source value and sets condition code flags C0, C2, and C3 in the FPU status word according to the results (see the table below). The source operand can be a data register or a memory location. If no source operand is given, the value in ST(0) is compared with the value in ST(1). The sign of zero is ignored, so that 0.0 is equal to +0.0. Table 3-26. FCOM/FCOMP/FCOMPP Results Condition ST(0) > SRC ST(0) < SRC ST(0) = SRC Unordered* C3 0 0 1 1 C2 0 0 0 1 C0 0 1 0 1 NOTES: * Flags not set if unmasked invalid-arithmetic-operand (#IA) exception is generated. This instruction checks the class of the numbers being compared (see "FXAM--ExamineModR/M" in this chapter). If either operand is a NaN or is in an unsupported format, an invalid-arithmetic-operand exception (#IA) is raised and, if the exception is masked, the condition flags are set to "unordered." If the invalid-arithmeticoperand exception is unmasked, the condition code flags are not set. Vol. 2 3-303 INSTRUCTION SET REFERENCE, A-M The FCOMP instruction pops the register stack following the comparison operation and the FCOMPP instruction pops the register stack twice following the comparison operation. To pop the register stack, the processor marks the ST(0) register as empty and increments the stack pointer (TOP) by 1. The FCOM instructions perform the same operation as the FUCOM instructions. The only difference is how they handle QNaN operands. The FCOM instructions raise an invalid-arithmetic-operand exception (#IA) when either or both of the operands is a NaN value or is in an unsupported format. The FUC...
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