OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgfortran/] [m4/] [misc_specifics.m4] - Blame information for rev 866

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 733 jeremybenn
include(head.m4)dnl
2
dnl
3
dnl This file contains the specific functions that are not handled in the
4
dnl m4/specific.m4 file.
5
 
6
#include "config.h"
7
#include "kinds.inc"
8
 
9
dnl This is from GNU m4 examples file foreach.m4:
10
divert(-1)
11
# foreach(x, (item_1, item_2, ..., item_n), stmt)
12
define(`foreach', `pushdef(`$1', `')_foreach(`$1', `$2',
13
`$3')popdef(`$1')')
14
define(`_arg1', `$1')
15
define(`_foreach',
16
        `ifelse(`$2', `()', ,
17
                `define(`$1', _arg1$2)$3`'_foreach(`$1', (shift$2),
18
`$3')')')
19
# traceon(`define', `foreach', `_foreach', `ifelse')
20
divert
21
 
22
dnl   NINT specifics
23
foreach(`ikind', `(4, 8, 16)', `foreach(`rkind', `(4, 8, 10, 16)', `
24
`#if defined (HAVE_GFC_REAL_'rkind`) && defined (HAVE_GFC_INTEGER_'ikind`)'
25
elemental function _gfortran_specific__nint_`'ikind`_'rkind (parm)
26
   real (kind=rkind) , intent (in) :: parm
27
   integer (kind=ikind) :: _gfortran_specific__nint_`'ikind`_'rkind
28
   _gfortran_specific__nint_`'ikind`_'rkind = nint (parm)
29
end function
30
#endif
31
')')
32
 
33
dnl   CHAR specifics
34
foreach(`ckind', `(1)', `foreach(`ikind', `(4, 8, 16)', `
35
`#if defined (HAVE_GFC_INTEGER_'ikind`)'
36
elemental function _gfortran_specific__char_`'ckind`_i'ikind (parm)
37
   integer (kind=ikind) , intent (in) :: parm
38
   character (kind=ckind,len=1) :: _gfortran_specific__char_`'ckind`_i'ikind
39
   _gfortran_specific__char_`'ckind`_i'ikind` = char (parm, kind='ckind`)'
40
end function
41
#endif
42
')')
43
 
44
dnl   LEN specifics
45
foreach(`ckind', `(1)', `foreach(`ikind', `(4, 8, 16)', `
46
`#if defined (HAVE_GFC_INTEGER_'ikind`)'
47
elemental function _gfortran_specific__len_`'ckind`_i'ikind (parm)
48
   character (kind=ckind,len=*) , intent (in) :: parm
49
   integer (kind=ikind) :: _gfortran_specific__len_`'ckind`_i'ikind
50
   _gfortran_specific__len_`'ckind`_i'ikind` = len (parm)'
51
end function
52
#endif
53
')')
54
 
55
dnl   INDEX specifics
56
foreach(`ckind', `(1)', `foreach(`ikind', `(4, 8, 16)', `
57
`#if defined (HAVE_GFC_INTEGER_'ikind`)'
58
elemental function _gfortran_specific__index_`'ckind`_i'ikind (parm1, parm2)
59
   character (kind=ckind,len=*) , intent (in) :: parm1, parm2
60
   integer (kind=ikind) :: _gfortran_specific__index_`'ckind`_i'ikind
61
   _gfortran_specific__index_`'ckind`_i'ikind` = index (parm1, parm2)'
62
end function
63
#endif
64
')')

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.