Intel 64 and IA-32 Architectures Software Developers Manual Volume 2A, Instruction Set Reference, A-M

Vol. 2 3-375
INSTRUCTION SET REFERENCE, A-M
FSCALE—Scale
Description
Truncates the value in the source operand (toward 0) to an integral value and adds
that value to the exponent of the destination operand. The destination and source
operands are floating-point values located in registers ST(0) and ST(1), respectively.
This instruction provides rapid multiplication or division by integral powers of 2. The
following table shows the results obtained when scaling various classes of numbers,
assuming that neither overflow nor underflow occurs.
In most cases, only the exponent is changed and the mantissa (significand) remains
unchanged. However, when the value being scaled in ST(0) is a denormal value, the
mantissa is also changed and the result may turn out to be a normalized number.
Similarly, if overflow or underflow results from a scale operation, the resulting
mantissa will differ from the source’s mantissa.
The FSCALE instruction can also be used to reverse the action of the FXTRACT
instruction, as shown in the following example:
FXTRACT;
FSCALE;
FSTP ST(1);
Opcode Instruction
64-Bit
Mode
Compat/
Leg Mode Description
D9 FD FSCALE Valid Valid Scale ST(0) by ST(1).
Table 3-39. FSCALE Results
ST(1)
−∞
F 0 +0 +F +∞
NaN
−∞ NaN −∞ −∞ −∞ −∞ −∞ NaN
ST(0) F 0 F F F F
NaN
0 0 0
0 0
0
NaN NaN
+
0 +0 +0 +0 +0 +0
NaN NaN
+F +0 +F +F +F +F +∞
NaN
+∞
NaN
+∞ +∞ +∞ +∞ +∞
NaN
NaN
NaN NaN NaN NaN NaN NaN NaN
NOTES:
F Means finite floating-point value.