exp2.s revision ddc0e0b53c661f6e439e3b7072b3ef353eadb4af
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * CDDL HEADER START
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * The contents of this file are subject to the terms of the
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * Common Development and Distribution License (the "License").
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * You may not use this file except in compliance with the License.
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * or http://www.opensolaris.org/os/licensing.
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * See the License for the specific language governing permissions
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * and limitations under the License.
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * When distributing Covered Code, include this CDDL HEADER in each
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * If applicable, add the following below this CDDL HEADER, with the
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * fields enclosed by brackets "[]" replaced with your own identifying
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * information: Portions Copyright [yyyy] [name of copyright owner]
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * CDDL HEADER END
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore * Use is subject to license terms.
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore je .check_tail / |x| may be only slightly < ln(2)
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore cmpl $0x7ff00000,%ecx / hi_32(|x|) >= hi_32(INF)?
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore cmpl $0x00000000,%edx / Is |x| slightly > 1?
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore ja .finite_non_special / branch if |x| slightly > 1
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore fldl 4(%esp) / push x
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore f2xm1 / 2**x - 1
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore fld1 / 1,2**x - 1
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore faddp %st,%st(1) / 2**x
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore cmpl $0x7ff00000,%ecx / hi_32(|x|) > hi_32(INF)?
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore ja .NaN_or_pinf / if so, x is NaN
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore movl 4(%esp),%edx / edx <-- lo_32(x)
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore cmpl $0,%edx / lo_32(x) = 0?
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore jne .NaN_or_pinf / if not, x is NaN
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore movl 8(%esp),%eax / eax <-- hi_32(x)
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore andl $0x80000000,%eax / here, x is infinite, but +/-?
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore jz .NaN_or_pinf / branch if x = +INF
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore fldz / Here, x = -inf, so return 0