25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * CDDL HEADER START
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * The contents of this file are subject to the terms of the
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Common Development and Distribution License (the "License").
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * You may not use this file except in compliance with the License.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * or http://www.opensolaris.org/os/licensing.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * See the License for the specific language governing permissions
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * and limitations under the License.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * When distributing Covered Code, include this CDDL HEADER in each
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * If applicable, add the following below this CDDL HEADER, with the
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * fields enclosed by brackets "[]" replaced with your own identifying
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * information: Portions Copyright [yyyy] [name of copyright owner]
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * CDDL HEADER END
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Use is subject to license terms.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Copyright 2011, Richard Lowe.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis/* Functions in this file are duplicated in locallibm.il. Keep them in sync */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis __asm__ __volatile__("sqrtss %1, %0\n\t" : "=x" (ret) : "x" (a));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis __asm__ __volatile__("sqrtsd %1, %0\n\t" : "=x" (ret) : "x" (a));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * 00 - 24 bits
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * 01 - reserved
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * 10 - 53 bits
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * 11 - 64 bits
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis __asm__ __volatile__("fstcw %0\n\t" : "=m" (cw));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis __asm__ __volatile__("fldcw %0\n\t" : : "m" (cw));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * 00 - Round to nearest, with even preferred
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * 01 - Round down
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * 10 - Round up
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis __asm__ __volatile__("fstcw %0\n\t" : "=m" (cw));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis __asm__ __volatile__("fldcw %0\n\t" : : "m" (cw));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "movl %1, %0\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "cmovnsl %1, %0\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "movd %3, %1\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "andpd %1, %0\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "andnpd %2, %1\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "orpd %1, %0\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "movd %2, %1\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "andpd %1, %0"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "andpd %1, %0"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "movq %2, %1\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "andq %1, %0\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "movq $0x7ff0000000000000, %1\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "subq %1, %0\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "shrq $63, %0\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "movmskpd %1, %0\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis "andq $1, %0\n\t"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#endif /* __GNUC__ */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#endif /* _LIBM_INLINES_H */