aboutsummaryrefslogtreecommitdiff
path: root/gcc/m2/gm2-gcc/m2builtins.def
blob: defe003ed660f9f3655e3df0361304e6a98e014e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
(* m2builtins.def definition module for m2builtins.cc.

Copyright (C) 2003-2024 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.

This file is part of GNU Modula-2.

GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.  *)

DEFINITION MODULE FOR "C" m2builtins ;

FROM SYSTEM IMPORT ADDRESS ;
FROM m2tree IMPORT Tree ;
FROM m2linemap IMPORT location_t ;

EXPORT QUALIFIED GetBuiltinConst, GetBuiltinConstType,
                 GetBuiltinTypeInfoType, GetBuiltinTypeInfo,
                 BuiltinExists, BuildBuiltinTree,
                 BuiltinMemCopy, BuiltinMemSet, BuiltInAlloca,
		 BuiltInIsfinite ;


(*
   GetBuiltinConst - returns the gcc tree of a built in constant, name.
                     NIL is returned if the constant is unknown.
*)

PROCEDURE GetBuiltinConst (name: ADDRESS) : Tree ;


(*
   GetBuiltinConstType - returns the type of a builtin constant, name.

                         0 = unknown constant name
                         1 = integer
                         2 = real
*)

PROCEDURE GetBuiltinConstType (name: ADDRESS) : CARDINAL ;



(*
   GetBuiltinTypeInfoType - returns value:
                            0    is ident is unknown.
                            1    if ident is IEC559, LIA1, ISO, IEEE, rounds, underflow,
                                             exception, extend.
                            2    if ident is radix, places, exponentmin, exponentmax,
                                             noofmodes.
                            3    if ident is large, small.
*)

PROCEDURE GetBuiltinTypeInfoType (ident: ADDRESS) : CARDINAL ;


(*
   GetBuiltinTypeInfo - returns a Tree value:

                        NULL_TREE        if ident is unknown.
                        boolean Tree     if ident is IEC559, LIA1, ISO, IEEE, rounds, underflow,
                                         exception, extend.
                        ZType Tree       if ident is radix, places, exponentmin, exponentmax,
                                         noofmodes.
                        RType Tree       if ident is large, small.
*)

PROCEDURE GetBuiltinTypeInfo (location: location_t; type: Tree; ident: ADDRESS) : Tree ;


(*
   BuiltinExists - returns TRUE if the builtin function, name, exists
                   for this target architecture.
*)

PROCEDURE BuiltinExists (name: ADDRESS) : BOOLEAN ;


(*
   BuildBuiltinTree - returns a Tree containing the builtin function, name.
*)

PROCEDURE BuildBuiltinTree (location: location_t; name: ADDRESS) : Tree ;


(*
   BuiltinMemCopy and BuiltinAlloca - are called by M2GenGCC to implement open arrays.
*)

PROCEDURE BuiltinMemCopy (location: location_t; dest, src, n: Tree) : Tree ;


(*
   BuiltinMemSet is called by M2GenGCC to implement the set type.
*)

PROCEDURE BuiltinMemSet (location: location_t; dest, bytevalue, nbytes: Tree) : Tree ;


(*
   BuiltInAlloca - given an expression, n, allocate, n, bytes on the stack for the life
                   of the current function.
*)

PROCEDURE BuiltInAlloca (location: location_t; n: Tree) : Tree ;


(*
   BuiltInIsfinite - given an expression, e, return an integer Tree of 1 if the
                     value is finite.  Return an integer Tree 0 if the value is
                     not finite.
*)

PROCEDURE BuiltInIsfinite (location: location_t; e: Tree) : Tree ;


END m2builtins.