3-287
INSTRUCTION SET REFERENCE
FYL2XCompute y
?
log
2
x
Description
This instruction calculates (ST(1)
?
log
2
(ST(0))), stores the result in resister 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.
NOTES:
FMeans finite-real number.
*Indicates floating-point invalid operation (#IA) exception.
**Indicates floating-point zero-divide (#Z) exception.
If the divide-by-zero exception is masked and register ST(0) contains
±
0, the instruction returns
?
with a sign that is the opposite of the sign of the source operand in register ST(1).
The FYL2X instruction is designed with a built-in multiplication to optimize the calculation of
logarithms with an arbitrary positive base (b):
log
b
x = (log
2
b)
1
?
log
2
x
Operation
ST(1)
<
ST(1)
?
log
2
ST(0);
PopRegisterStack;
Opcode
Instruction
Description
D9 F1
FYL2X
Replace ST(1) with (ST(1)
?
log
2
ST(0)) and pop the
register stack
ST(0)
???
F
±
0
+
0 < +F < +1+1
+
F > +1+
?
NaN
??
**+
?
+
?
*
????
NaN
ST(1)
?
F****
+F
?
0
?
F
??
NaN
?
0***
+0
?
0
?
0*NaN
+
0***
?
0
+
0
+
0*NaN
+
F****
?
F
+
0+F+
?
NaN
+
?
**
??
??
?
+
?
+
?
NaN
NaNNaNNaNNaNNaNNaNNaNNaNNaN