e_exp.S (50476) | e_exp.S (61335) |
---|---|
1/* 2 * Copyright (c) 1993,94 Winning Strategies, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 31/* 32 * Written by: 33 * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. 34 */ 35 36#include <machine/asm.h> 37 | 1/* 2 * Copyright (c) 1993,94 Winning Strategies, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 31/* 32 * Written by: 33 * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. 34 */ 35 36#include <machine/asm.h> 37 |
38RCSID("$FreeBSD: head/lib/msun/i387/e_exp.S 50476 1999-08-28 00:22:10Z peter $") | 38RCSID("$FreeBSD: head/lib/msun/i387/e_exp.S 61335 2000-06-06 12:12:36Z bde $") |
39 40/* e^x = 2^(x * log2(e)) */ 41ENTRY(__ieee754_exp) 42 /* 43 * If x is +-Inf, then the subtraction would give Inf-Inf = NaN. 44 * Avoid this. Also avoid it if x is NaN for convenience. 45 */ 46 movl 8(%esp),%eax --- 13 unchanged lines hidden (view full) --- 60 andl $0x0300,%eax 61 cmpl $0x0300,%eax /* RC == 0 && PC == 3? */ 62 je 1f /* jump if mode is good */ 63 movl $0x137f,8(%esp) 64 fldcw 8(%esp) 651: 66 fldl2e 67 fmulp /* x * log2(e) */ | 39 40/* e^x = 2^(x * log2(e)) */ 41ENTRY(__ieee754_exp) 42 /* 43 * If x is +-Inf, then the subtraction would give Inf-Inf = NaN. 44 * Avoid this. Also avoid it if x is NaN for convenience. 45 */ 46 movl 8(%esp),%eax --- 13 unchanged lines hidden (view full) --- 60 andl $0x0300,%eax 61 cmpl $0x0300,%eax /* RC == 0 && PC == 3? */ 62 je 1f /* jump if mode is good */ 63 movl $0x137f,8(%esp) 64 fldcw 8(%esp) 651: 66 fldl2e 67 fmulp /* x * log2(e) */ |
68 fstl %st(1) | 68 fst %st(1) |
69 frndint /* int(x * log2(e)) */ | 69 frndint /* int(x * log2(e)) */ |
70 fstl %st(2) | 70 fst %st(2) |
71 fsubrp /* fract(x * log2(e)) */ 72 f2xm1 /* 2^(fract(x * log2(e))) - 1 */ 73 fld1 74 faddp /* 2^(fract(x * log2(e))) */ 75 fscale /* e^x */ | 71 fsubrp /* fract(x * log2(e)) */ 72 f2xm1 /* 2^(fract(x * log2(e))) - 1 */ 73 fld1 74 faddp /* 2^(fract(x * log2(e))) */ 75 fscale /* e^x */ |
76 fstpl %st(1) | 76 fstp %st(1) |
77 je 1f 78 fldcw 4(%esp) 791: 80 ret 81 82x_Inf_or_NaN: 83 /* 84 * Return 0 if x is -Inf. Otherwise just return x, although the --- 12 unchanged lines hidden --- | 77 je 1f 78 fldcw 4(%esp) 791: 80 ret 81 82x_Inf_or_NaN: 83 /* 84 * Return 0 if x is -Inf. Otherwise just return x, although the --- 12 unchanged lines hidden --- |