da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Common Development and Distribution License, Version 1.0 only
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * (the "License"). You may not use this file except in compliance
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * or http://www.opensolaris.org/os/licensing.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER END
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
c586600796766c83eb9485c446886fd9ed2359a9Keyur Desai/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Copyright 1988 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#pragma ident "%Z%%M% %I% %E% SMI"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include "_Qquad.h"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include "_Qglobals.h"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwSINGLERESULT
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw_Q_qtos(QUAD x)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw unpacked px;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw float s;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw _fp_current_exceptions = 0;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw _Q_get_rp_rd();
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw _fp_unpack(&px, (int *)&x,fp_op_extended);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw _fp_pack(&px, (int *)&s,fp_op_single);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw _Q_set_exception(_fp_current_exceptions);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw RETURNSINGLE(s);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw