* config/i386/i386.md (extendsfdf2, extendsfxf2, extenddfxf2): Do not
[official-gcc.git] / libgfortran / intrinsics / selected_int_kind.f90
blob80bc25b00bc4b80dafe6654dedf9afad1645e223
1 ! Copyright 2003, 2004 Free Software Foundation, Inc.
2 ! Contributed by Kejia Zhao <kejia_zh@yahoo.com.cn>
4 !This file is part of the GNU Fortran 95 runtime library (libgfor).
6 !GNU libgfor is free software; you can redistribute it and/or
7 !modify it under the terms of the GNU Lesser General Public
8 !License as published by the Free Software Foundation; either
9 !version 2.1 of the License, or (at your option) any later version.
11 !GNU libgfor is distributed in the hope that it will be useful,
12 !but WITHOUT ANY WARRANTY; without even the implied warranty of
13 !MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 !GNU Lesser General Public License for more details.
16 !You should have received a copy of the GNU Lesser General Public
17 !License along with libgfor; see the file COPYING. If not,
18 !write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 !Boston, MA 02110-1301, USA.
22 function selected_int_kind (r)
23 implicit none
24 integer, intent (in) :: r
25 integer :: selected_int_kind
26 integer :: i
27 ! Integer kind_range table
28 type :: int_info
29 integer :: kind
30 integer :: range
31 end type int_info
33 include "selected_int_kind.inc"
35 do i = 1, c
36 if (r <= int_infos (i) % range) then
37 selected_int_kind = int_infos (i) % kind
38 return
39 end if
40 end do
41 selected_int_kind = -1
42 return
43 end function