e_exp.S (3a8617a83f16ffc9db4f96e1f0f21af94078e6b1) e_exp.S (ec8cc6082c0ef5ab7ee0b3d1f06293d50693c7c3)
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

--- 19 unchanged lines hidden (view full) ---

28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/*
32 * Written by:
33 * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
34 */
35
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

--- 19 unchanged lines hidden (view full) ---

28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/*
32 * Written by:
33 * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
34 */
35
36#include <machine/asm.h>
36#include <machine/asmacros.h>
37
37
38RCSID("$Id: e_exp.S,v 1.2 1994/03/12 01:30:27 jtc Exp $")
38RCSID("$Id: e_exp.S,v 1.1.1.1 1994/08/19 09:40:00 jkh Exp $")
39
40/* e^x = 2^(x * log2(e)) */
41ENTRY(__ieee754_exp)
42 fldl 4(%esp)
43 fldl2e
44 fmulp /* x * log2(e) */
45 fstl %st(1)
46 frndint /* int(x * log2(e)) */
47 fstl %st(2)
48 fsubrp /* fract(x * log2(e)) */
49 f2xm1 /* 2^(fract(x * log2(e))) - 1 */
50 fld1
51 faddp /* 2^(fract(x * log2(e))) */
52 fscale /* e^x */
53 ret
39
40/* e^x = 2^(x * log2(e)) */
41ENTRY(__ieee754_exp)
42 fldl 4(%esp)
43 fldl2e
44 fmulp /* x * log2(e) */
45 fstl %st(1)
46 frndint /* int(x * log2(e)) */
47 fstl %st(2)
48 fsubrp /* fract(x * log2(e)) */
49 f2xm1 /* 2^(fract(x * log2(e))) - 1 */
50 fld1
51 faddp /* 2^(fract(x * log2(e))) */
52 fscale /* e^x */
53 ret