9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER START
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * The contents of this file are subject to the terms of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Common Development and Distribution License (the "License").
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You may not use this file except in compliance with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * or http://www.opensolaris.org/os/licensing.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * See the License for the specific language governing permissions
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * and limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * When distributing Covered Code, include this CDDL HEADER in each
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * If applicable, add the following below this CDDL HEADER, with the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * fields enclosed by brackets "[]" replaced with your own identifying
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * information: Portions Copyright [yyyy] [name of copyright owner]
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER END
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
f6acbf7c6543dc0aab58cae1df419f0147c46d77rie * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Use is subject to license terms.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl#pragma ident "%Z%%M% %I% %E% SMI"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma weak _fpgetsticky = fpgetsticky
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
4fe01614e64281d82c5a22f0050e55f1e0bdbdaeraf#include "lint.h"
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl#include <ieeefp.h>
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
73427c57f824c3ec3b396181b163f37d50c5b3b1ahlextern int _sse_hw;
f6acbf7c6543dc0aab58cae1df419f0147c46d77rieextern void _getsw(int *), _getmxcsr(int *);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
73427c57f824c3ec3b396181b163f37d50c5b3b1ahlfp_except
73427c57f824c3ec3b396181b163f37d50c5b3b1ahlfpgetsticky(void)
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl{
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl int sw, mxcsr;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl _getsw(&sw);
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl if (_sse_hw) {
9512fe850e98fdd448c638ca63fdd92a8a510255ahl _getmxcsr(&mxcsr);
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl sw |= mxcsr;
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl }
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl return ((fp_except)(sw & 0x3f));
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl}
9512fe850e98fdd448c638ca63fdd92a8a510255ahl