3-238
INSTRUCTION SET REFERENCE
FSCALEScale
Description
This instruction multiplies the destination operand by 2 to the power of the source operand and
stores the result in the destination operand. The destination operand is a real value that is located
in register ST(0). The source operand is the nearest integer value that is smaller than the value
in the ST(1) register (that is, the value in register ST(1) is truncated toward 0 to its nearest
integer value to form the source operand). This instruction provides rapid multiplication or divi-
sion by integral powers of 2 because it is implemented by simply adding an integer value (the
source operand) to the exponent of the value in register ST(0). The following table shows the
results obtained when scaling various classes of numbers, assuming that neither overflow nor
underflow occurs.
NOTES:
FMeans finite-real number.
NMeans integer.
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 sources 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
Description
D9 FD
FSCALE
Scale ST(0) by ST(1).
ST(1)
?
N
0
+N
??
??
??
??
ST(0)
?
F
?
F
?
F
?
F
?
0
?
0
?
0
?
0
+0
+0
+0
+0
+F
+F
+F
+F
+
?
+
?
+
?
+
?
NaN
NaN
NaN
NaN