| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Written by J.T. Conklin <jtc@netbsd.org>. | 2 * Written by J.T. Conklin <jtc@netbsd.org>. |
| 3 * Public domain. | 3 * Public domain. |
| 4 * | 4 * |
| 5 * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. | 5 * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. |
| 6 * | 6 * |
| 7 * Correct handling of y==-inf <drepper@gnu> | 7 * Correct handling of y==-inf <drepper@gnu> |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #include <machine/asm.h> | 10 #include <machine/asm.h> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 cmpl $0x0100, %eax | 54 cmpl $0x0100, %eax |
| 55 je 3f | 55 je 3f |
| 56 fld %st(1) | 56 fld %st(1) |
| 57 frndint | 57 frndint |
| 58 fcomp %st(2) | 58 fcomp %st(2) |
| 59 fnstsw | 59 fnstsw |
| 60 sahf | 60 sahf |
| 61 jne 4f | 61 jne 4f |
| 62 fscale | 62 fscale |
| 63 fstp %st(1) | 63 fstp %st(1) |
| 64 » ret | 64 » NACLRET |
| 65 | 65 |
| 66 /* y is -inf */ | 66 /* y is -inf */ |
| 67 1: fxam | 67 1: fxam |
| 68 #ifdef PIC | 68 #ifdef PIC |
| 69 LOAD_PIC_REG (cx) | 69 LOAD_PIC_REG (cx) |
| 70 #endif | 70 #endif |
| 71 fnstsw | 71 fnstsw |
| 72 movl 12(%esp), %edx | 72 movl 12(%esp), %edx |
| 73 shrl $5, %eax | 73 shrl $5, %eax |
| 74 fstp %st | 74 fstp %st |
| 75 fstp %st | 75 fstp %st |
| 76 andl $0x8000, %edx | 76 andl $0x8000, %edx |
| 77 andl $8, %eax | 77 andl $8, %eax |
| 78 jnz 4f | 78 jnz 4f |
| 79 shrl $11, %edx | 79 shrl $11, %edx |
| 80 addl %edx, %eax | 80 addl %edx, %eax |
| 81 fldl MOX(zero_nan, %eax, 1) | 81 fldl MOX(zero_nan, %eax, 1) |
| 82 » ret | 82 » NACLRET |
| 83 | 83 |
| 84 /* The result is NaN, but we must not raise an exception. | 84 /* The result is NaN, but we must not raise an exception. |
| 85 So use a variable. */ | 85 So use a variable. */ |
| 86 2: fstp %st | 86 2: fstp %st |
| 87 fstp %st | 87 fstp %st |
| 88 #ifdef PIC | 88 #ifdef PIC |
| 89 LOAD_PIC_REG (cx) | 89 LOAD_PIC_REG (cx) |
| 90 #endif | 90 #endif |
| 91 fldl MO(nan) | 91 fldl MO(nan) |
| 92 » ret | 92 » NACLRET |
| 93 | 93 |
| 94 /* The first parameter is a NaN. Return it. */ | 94 /* The first parameter is a NaN. Return it. */ |
| 95 3: fstp %st(1) | 95 3: fstp %st(1) |
| 96 » ret | 96 » NACLRET |
| 97 | 97 |
| 98 /* Return NaN and raise the invalid exception. */ | 98 /* Return NaN and raise the invalid exception. */ |
| 99 4: fstp %st | 99 4: fstp %st |
| 100 fstp %st | 100 fstp %st |
| 101 fldz | 101 fldz |
| 102 fdiv %st | 102 fdiv %st |
| 103 » ret | 103 » NACLRET |
| 104 END(__ieee754_scalbl) | 104 END(__ieee754_scalbl) |
| OLD | NEW |