7-35
FLOATING-POINT UNIT
7.5.5.Basic Arithmetic Instructions
The following floating-point instructions perform basic arithmetic operations on real numbers.
Where applicable, these instructions match IEEE Standard 754:
FADD/FADDP
Add real
FIADD
Add integer to real
FSUB/FSUBP
Subtract real
FISUB
Subtract integer from real
FSUBR/FSUBRP
Reverse subtract real
FISUBR
Reverse subtract real from integer
FMUL/FMULP
Multiply real
FIMUL
Multiply integer by real
FDIV/FDIVP
Divide real
FIDIV
Divide real by integer
FDIVR/FDIVRP
Reverse divide
FIDIVR
Reverse divide integer by real
FABS
Absolute value
FCHS
Change sign
FSQRT
Square root
FPREM
Partial remainder
FPREM1
IEEE partial remainder
FRNDINT
Round to integral value
FXTRACT
Extract exponent and significand
The add, subtract, multiply and divide instructions operate on the following types of operands:
Two FPU register values.
A register value and a real or integer value in memory.
Operands in memory can be in single-real, double-real, short-integer, or word-integer format.
They are converted to extended-real format automatically.
Reverse versions of the subtract and divide instructions are provided to foster efficient coding.
For example, the FSUB instruction subtracts the value in a specified FPU register [ST(i)] from
the value in register ST(0); whereas, the FSUBR instruction subtracts the value in ST(0) from
the value in ST(i). The results of both operations are stored in register ST(0). These instructions
eliminate the need to exchange values between register ST(0) and another FPU register to
perform a subtraction or division.
The pop versions of the add, subtract, multiply and divide instructions pop the FPU register
stack following the arithmetic operation.
The FPREM instruction computes the remainder from the division of two operands in the
manner used by the Intel 8087 and Intel 287 math coprocessors; the FPREM1 instructions
computes the remainder is the manner specified in the IEEE specification.
The FSQRT instruction computes the square root of the source operand.
The FRNDINT instructions rounds a real value to its nearest integer value, according to the
current rounding mode specified in the RC field of the FPU control word. This instruction