| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Written by J.T. Conklin <jtc@netbsd.org>. | 2 * Written by J.T. Conklin <jtc@netbsd.org>. |
| 3 * Adapted for use as log2 by Ulrich Drepper <drepper@cygnus.com>. | 3 * Adapted for use as log2 by Ulrich Drepper <drepper@cygnus.com>. |
| 4 * Public domain. | 4 * Public domain. |
| 5 * | 5 * |
| 6 * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. | 6 * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include <machine/asm.h> | 9 #include <machine/asm.h> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 jc 3f // in case x is NaN or ±Inf | 45 jc 3f // in case x is NaN or ±Inf |
| 46 4: fsub %st(2), %st // x-1 : x : 1 | 46 4: fsub %st(2), %st // x-1 : x : 1 |
| 47 fld %st // x-1 : x-1 : x : 1 | 47 fld %st // x-1 : x-1 : x : 1 |
| 48 fabs // |x-1| : x-1 : x : 1 | 48 fabs // |x-1| : x-1 : x : 1 |
| 49 fcompl MO(limit) // x-1 : x : 1 | 49 fcompl MO(limit) // x-1 : x : 1 |
| 50 fnstsw // x-1 : x : 1 | 50 fnstsw // x-1 : x : 1 |
| 51 andb $0x45, %ah | 51 andb $0x45, %ah |
| 52 jz 2f | 52 jz 2f |
| 53 fstp %st(1) // x-1 : 1 | 53 fstp %st(1) // x-1 : 1 |
| 54 fyl2xp1 // log(x) | 54 fyl2xp1 // log(x) |
| 55 » ret | 55 » NACLRET |
| 56 | 56 |
| 57 2: fstp %st(0) // x : 1 | 57 2: fstp %st(0) // x : 1 |
| 58 fyl2x // log(x) | 58 fyl2x // log(x) |
| 59 » ret | 59 » NACLRET |
| 60 | 60 |
| 61 3: jp 4b // in case x is ±Inf | 61 3: jp 4b // in case x is ±Inf |
| 62 fstp %st(1) | 62 fstp %st(1) |
| 63 fstp %st(1) | 63 fstp %st(1) |
| 64 » ret | 64 » NACLRET |
| 65 END (__ieee754_log2) | 65 END (__ieee754_log2) |
| OLD | NEW |