FSCALE

Scale

stableVMJITAOTinstruction

Encodings

OpcodeInstructionOp/En64-bitCompat/LegacyDescription
D9 FDFSCALEValidValidScale ST(0) by ST(1).

Measured cost

Loading measurements from arch-data...

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.

FSCALE Results

ST(0)-F-0-F-F-F-F-NaN
-0-0-0-0-0-0NaNNaN
+0+0+0+0+0+0NaNNaN
+F+0+F+F+F+F+NaN
+NaN+++++NaN
NaNNaNNaN NaNNaNNaNNaNNaN

Operation

ST(0) := ST(0)  2RoundTowardZero(ST(1));

FPU Flags Affected

C1                    Set to 0 if stack underflow occurred.

                      Set if result was rounded up; cleared otherwise.

C0, C2, C3            Undefined.

Floating-Point Exceptions

#IS            Stack underflow occurred.
#IA            Source operand is an SNaN value or unsupported format.
#D             Source operand is a denormal value.
#U             Result is too small for destination format.
#O             Result is too large for destination format.
#P             Value cannot be represented exactly in destination format.

Exceptions

Protected mode
#NMCR0.EM[bit 2] or CR0.TS[bit 3] = 1.
#MFIf there is a pending x87 FPU exception.
#UDIf the LOCK prefix is used.
Real address mode
Same exceptions as in protected mode.
Virtual-8086 mode
Same exceptions as in protected mode.
Compatibility mode
Same exceptions as in protected mode.
64-bit mode
Same exceptions as in protected mode.

Sources