xref: /openbsd/gnu/gcc/gcc/config/soft-fp/floatunsitf.c (revision 404b540a)
1*404b540aSrobert /* Software floating-point emulation.
2*404b540aSrobert    Convert a 32bit unsigned integer to IEEE quad
3*404b540aSrobert    Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
4*404b540aSrobert    This file is part of the GNU C Library.
5*404b540aSrobert    Contributed by Richard Henderson (rth@cygnus.com) and
6*404b540aSrobert 		  Jakub Jelinek (jj@ultra.linux.cz).
7*404b540aSrobert 
8*404b540aSrobert    The GNU C Library is free software; you can redistribute it and/or
9*404b540aSrobert    modify it under the terms of the GNU Lesser General Public
10*404b540aSrobert    License as published by the Free Software Foundation; either
11*404b540aSrobert    version 2.1 of the License, or (at your option) any later version.
12*404b540aSrobert 
13*404b540aSrobert    In addition to the permissions in the GNU Lesser General Public
14*404b540aSrobert    License, the Free Software Foundation gives you unlimited
15*404b540aSrobert    permission to link the compiled version of this file into
16*404b540aSrobert    combinations with other programs, and to distribute those
17*404b540aSrobert    combinations without any restriction coming from the use of this
18*404b540aSrobert    file.  (The Lesser General Public License restrictions do apply in
19*404b540aSrobert    other respects; for example, they cover modification of the file,
20*404b540aSrobert    and distribution when not linked into a combine executable.)
21*404b540aSrobert 
22*404b540aSrobert    The GNU C Library is distributed in the hope that it will be useful,
23*404b540aSrobert    but WITHOUT ANY WARRANTY; without even the implied warranty of
24*404b540aSrobert    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25*404b540aSrobert    Lesser General Public License for more details.
26*404b540aSrobert 
27*404b540aSrobert    You should have received a copy of the GNU Lesser General Public
28*404b540aSrobert    License along with the GNU C Library; if not, write to the Free
29*404b540aSrobert    Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
30*404b540aSrobert    MA 02110-1301, USA.  */
31*404b540aSrobert 
32*404b540aSrobert #include "soft-fp.h"
33*404b540aSrobert #include "quad.h"
34*404b540aSrobert 
35*404b540aSrobert TFtype
__floatunsitf(USItype i)36*404b540aSrobert __floatunsitf(USItype i)
37*404b540aSrobert {
38*404b540aSrobert   FP_DECL_EX;
39*404b540aSrobert   FP_DECL_Q(A);
40*404b540aSrobert   TFtype a;
41*404b540aSrobert 
42*404b540aSrobert   FP_FROM_INT_Q(A, i, SI_BITS, USItype);
43*404b540aSrobert   FP_PACK_RAW_Q(a, A);
44*404b540aSrobert   FP_HANDLE_EXCEPTIONS;
45*404b540aSrobert 
46*404b540aSrobert   return a;
47*404b540aSrobert }
48