Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: sysdeps/i386/fpu/e_exp2l.S

Issue 3539003: Fix up RET instructions in sysdeps/i386/fpu (Closed) Base URL: ssh://gitrw.chromium.org/nacl-glibc
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sysdeps/i386/fpu/e_exp2f.S ('k') | sysdeps/i386/fpu/e_expf.S » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Written by J.T. Conklin <jtc@netbsd.org>. 2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Adapted for exp2 by Ulrich Drepper <drepper@cygnus.com>. 3 * Adapted for exp2 by Ulrich Drepper <drepper@cygnus.com>.
4 * Public domain. 4 * Public domain.
5 */ 5 */
6 6
7 #include <machine/asm.h> 7 #include <machine/asm.h>
8 8
9 ENTRY(__ieee754_exp2l) 9 ENTRY(__ieee754_exp2l)
10 fldt 4(%esp) 10 fldt 4(%esp)
11 /* I added the following ugly construct because exp(+-Inf) resulted 11 /* I added the following ugly construct because exp(+-Inf) resulted
12 in NaN. The ugliness results from the bright minds at Intel. 12 in NaN. The ugliness results from the bright minds at Intel.
13 For the i686 the code can be written better. 13 For the i686 the code can be written better.
14 -- drepper@cygnus.com. */ 14 -- drepper@cygnus.com. */
15 fxam /* Is NaN or +-Inf? */ 15 fxam /* Is NaN or +-Inf? */
16 fstsw %ax 16 fstsw %ax
17 movb $0x45, %dh 17 movb $0x45, %dh
18 andb %ah, %dh 18 andb %ah, %dh
19 cmpb $0x05, %dh 19 cmpb $0x05, %dh
20 je 1f /* Is +-Inf, jump. */ 20 je 1f /* Is +-Inf, jump. */
21 fld %st 21 fld %st
22 frndint /* int(x) */ 22 frndint /* int(x) */
23 fsubr %st,%st(1) /* fract(x) */ 23 fsubr %st,%st(1) /* fract(x) */
24 fxch 24 fxch
25 f2xm1 /* 2^(fract(x)) - 1 */ 25 f2xm1 /* 2^(fract(x)) - 1 */
26 fld1 26 fld1
27 faddp /* 2^(fract(x)) */ 27 faddp /* 2^(fract(x)) */
28 fscale /* e^x */ 28 fscale /* e^x */
29 fstp %st(1) 29 fstp %st(1)
30 » ret 30 » NACLRET
31 31
32 1: testl $0x200, %eax /* Test sign. */ 32 1: testl $0x200, %eax /* Test sign. */
33 jz 2f /* If positive, jump. */ 33 jz 2f /* If positive, jump. */
34 fstp %st 34 fstp %st
35 fldz /* Set result to 0. */ 35 fldz /* Set result to 0. */
36 2:» ret 36 2:» NACLRET
37 END (__ieee754_exp2l) 37 END (__ieee754_exp2l)
OLDNEW
« no previous file with comments | « sysdeps/i386/fpu/e_exp2f.S ('k') | sysdeps/i386/fpu/e_expf.S » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698