floatdisf.c revision 169690
171867Smsmith/* Software floating-point emulation.
271867Smsmith   Convert a 64bit signed integer to IEEE single
371867Smsmith   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
471867Smsmith   This file is part of the GNU C Library.
571867Smsmith   Contributed by Richard Henderson (rth@cygnus.com) and
671867Smsmith		  Jakub Jelinek (jj@ultra.linux.cz).
771867Smsmith
871867Smsmith   The GNU C Library is free software; you can redistribute it and/or
971867Smsmith   modify it under the terms of the GNU Lesser General Public
1071867Smsmith   License as published by the Free Software Foundation; either
1171867Smsmith   version 2.1 of the License, or (at your option) any later version.
12202771Sjkim
1371867Smsmith   In addition to the permissions in the GNU Lesser General Public
1471867Smsmith   License, the Free Software Foundation gives you unlimited
1571867Smsmith   permission to link the compiled version of this file into
1671867Smsmith   combinations with other programs, and to distribute those
1771867Smsmith   combinations without any restriction coming from the use of this
1871867Smsmith   file.  (The Lesser General Public License restrictions do apply in
1971867Smsmith   other respects; for example, they cover modification of the file,
2071867Smsmith   and distribution when not linked into a combine executable.)
2171867Smsmith
2271867Smsmith   The GNU C Library is distributed in the hope that it will be useful,
2371867Smsmith   but WITHOUT ANY WARRANTY; without even the implied warranty of
2471867Smsmith   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2571867Smsmith   Lesser General Public License for more details.
2671867Smsmith
2771867Smsmith   You should have received a copy of the GNU Lesser General Public
2871867Smsmith   License along with the GNU C Library; if not, write to the Free
2971867Smsmith   Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
3071867Smsmith   MA 02110-1301, USA.  */
3171867Smsmith
3271867Smsmith#include "soft-fp.h"
3371867Smsmith#include "single.h"
3471867Smsmith
3571867SmsmithSFtype __floatdisf(DItype i)
3671867Smsmith{
3771867Smsmith  FP_DECL_EX;
3871867Smsmith  FP_DECL_S(A);
3971867Smsmith  SFtype a;
4071867Smsmith
4171867Smsmith  FP_FROM_INT_S(A, i, DI_BITS, UDItype);
4271867Smsmith  FP_PACK_RAW_S(a, A);
4371867Smsmith  FP_HANDLE_EXCEPTIONS;
4471867Smsmith
4571867Smsmith  return a;
4671867Smsmith}
4771867Smsmith