FYL2X
Compute y log2x
stableVMJITAOTinstruction
Encodings
| Opcode | Instruction | Op/En | 64-bit | Compat/Legacy | Description |
|---|---|---|---|---|---|
D9 F1 | FYL2X | Valid | Valid | Replace ST(1) with (ST(1) log2ST(0)) and pop the register stack. |
Measured cost
Loading measurements from arch-data...
Description
Computes (ST(1) log2 (ST(0))), stores the result in register ST(1), and pops the FPU register stack. The source operand in ST(0) must be a non-zero positive number.
The following table shows the results obtained when taking the log of various classes of numbers, assuming that neither overflow nor underflow occurs.
FYL2X Results
| ST(1) | -F | * | * | ** | +F | -0 | -F | - | NaN |
|---|---|---|---|---|---|---|---|---|---|
| -0 | * | * | * | +0 | -0 | -0 | * | NaN | |
| +0 | * | * | * | -0 | +0 | +0 | * | NaN | |
| +F | * | * | ** | -F | +0 | +F | + | NaN | |
| + | * | * | - | - | * | + | + | NaN |
Operation
ST(1) := ST(1) log2ST(0);
PopRegisterStack;
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 Either operand is an SNaN or unsupported format.Source operand in register ST(0) is a negative finite value (not -0).
#Z Source operand in register ST(0) is +/-0.#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
#NM | CR0.EM[bit 2] or CR0.TS[bit 3] = 1. |
#MF | If there is a pending x87 FPU exception. |
#UD | If 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. |