annotate gcc/go/gofrontend/runtime.def @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // runtime.def -- runtime functions called by generated code. -*- C++ -*-
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 // Copyright 2011 The Go Authors. All rights reserved.
kono
parents:
diff changeset
4 // Use of this source code is governed by a BSD-style
kono
parents:
diff changeset
5 // license that can be found in the LICENSE file.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 // Definitions for the Go runtime functions.
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 // Parameter type helper macros.
kono
parents:
diff changeset
10 #define ABFT6(T1, T2, T3, T4, T5, T6) \
kono
parents:
diff changeset
11 { RFT_ ## T1, RFT_ ## T2, RFT_ ## T3, RFT_ ## T4, RFT_ ## T5, RFT_ ## T6 }
kono
parents:
diff changeset
12 #define P0() ABFT6(VOID, VOID, VOID, VOID, VOID, VOID)
kono
parents:
diff changeset
13 #define P1(T) ABFT6(T, VOID, VOID, VOID, VOID, VOID)
kono
parents:
diff changeset
14 #define P2(T1, T2) ABFT6(T1, T2, VOID, VOID, VOID, VOID)
kono
parents:
diff changeset
15 #define P3(T1, T2, T3) ABFT6(T1, T2, T3, VOID, VOID, VOID)
kono
parents:
diff changeset
16 #define P4(T1, T2, T3, T4) ABFT6(T1, T2, T3, T4, VOID, VOID)
kono
parents:
diff changeset
17 #define P5(T1, T2, T3, T4, T5) ABFT6(T1, T2, T3, T4, T5, VOID)
kono
parents:
diff changeset
18 #define P6(T1,T2,T3,T4,T5,T6) ABFT6(T1, T2, T3, T4, T5, T6)
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 // Result type helper macros.
kono
parents:
diff changeset
21 #define ABFT2(T1, T2) { RFT_ ## T1, RFT_ ## T2 }
kono
parents:
diff changeset
22 #define R0() ABFT2(VOID, VOID)
kono
parents:
diff changeset
23 #define R1(T) ABFT2(T, VOID)
kono
parents:
diff changeset
24 #define R2(T1, T2) ABFT2(T1, T2)
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 // Define all the Go runtime functions. The first parameter is the
kono
parents:
diff changeset
27 // enum code used to refer to the function. The second parameter is
kono
parents:
diff changeset
28 // the name. The third is the parameter types and the fourth is the
kono
parents:
diff changeset
29 // result types.
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 // The standard C memcmp function, used for struct comparisons.
kono
parents:
diff changeset
32 DEF_GO_RUNTIME(MEMCMP, "__go_memcmp", P3(POINTER, POINTER, UINTPTR), R1(INT))
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 // Decode a non-ASCII rune from a string.
kono
parents:
diff changeset
35 DEF_GO_RUNTIME(DECODERUNE, "runtime.decoderune", P2(STRING, INT),
kono
parents:
diff changeset
36 R2(RUNE, INT))
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 // Concatenate strings.
kono
parents:
diff changeset
39 DEF_GO_RUNTIME(CONCATSTRINGS, "runtime.concatstrings", P2(POINTER, SLICE),
kono
parents:
diff changeset
40 R1(STRING))
kono
parents:
diff changeset
41 DEF_GO_RUNTIME(CONCATSTRING2, "runtime.concatstring2",
kono
parents:
diff changeset
42 P2(POINTER, ARRAY2STRING), R1(STRING))
kono
parents:
diff changeset
43 DEF_GO_RUNTIME(CONCATSTRING3, "runtime.concatstring3",
kono
parents:
diff changeset
44 P2(POINTER, ARRAY3STRING), R1(STRING))
kono
parents:
diff changeset
45 DEF_GO_RUNTIME(CONCATSTRING4, "runtime.concatstring4",
kono
parents:
diff changeset
46 P2(POINTER, ARRAY4STRING), R1(STRING))
kono
parents:
diff changeset
47 DEF_GO_RUNTIME(CONCATSTRING5, "runtime.concatstring5",
kono
parents:
diff changeset
48 P2(POINTER, ARRAY5STRING), R1(STRING))
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 // Compare two strings for equality.
kono
parents:
diff changeset
51 DEF_GO_RUNTIME(EQSTRING, "runtime.eqstring", P2(STRING, STRING), R1(BOOL))
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 // Compare two strings.
kono
parents:
diff changeset
54 DEF_GO_RUNTIME(CMPSTRING, "runtime.cmpstring", P2(STRING, STRING), R1(INT))
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 // Take a slice of a string.
kono
parents:
diff changeset
57 DEF_GO_RUNTIME(STRING_SLICE, "__go_string_slice", P3(STRING, INT, INT),
kono
parents:
diff changeset
58 R1(STRING))
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 // Convert an integer to a string.
kono
parents:
diff changeset
61 DEF_GO_RUNTIME(INTSTRING, "runtime.intstring", P2(POINTER, INT64), R1(STRING))
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 // Convert a []byte to a string.
kono
parents:
diff changeset
64 DEF_GO_RUNTIME(SLICEBYTETOSTRING, "runtime.slicebytetostring",
kono
parents:
diff changeset
65 P2(POINTER, SLICE), R1(STRING))
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 // Convert a []rune to a string.
kono
parents:
diff changeset
68 DEF_GO_RUNTIME(SLICERUNETOSTRING, "runtime.slicerunetostring",
kono
parents:
diff changeset
69 P2(POINTER, SLICE), R1(STRING))
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 // Convert a string to a []byte.
kono
parents:
diff changeset
72 DEF_GO_RUNTIME(STRINGTOSLICEBYTE, "runtime.stringtoslicebyte",
kono
parents:
diff changeset
73 P2(POINTER, STRING), R1(SLICE))
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 // Convert a string to a []rune.
kono
parents:
diff changeset
76 DEF_GO_RUNTIME(STRINGTOSLICERUNE, "runtime.stringtoslicerune",
kono
parents:
diff changeset
77 P2(POINTER, STRING), R1(SLICE))
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 // Complex division.
kono
parents:
diff changeset
81 DEF_GO_RUNTIME(COMPLEX64_DIV, "__go_complex64_div",
kono
parents:
diff changeset
82 P2(COMPLEX64, COMPLEX64), R1(COMPLEX64))
kono
parents:
diff changeset
83 DEF_GO_RUNTIME(COMPLEX128_DIV, "__go_complex128_div",
kono
parents:
diff changeset
84 P2(COMPLEX128, COMPLEX128), R1(COMPLEX128))
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 // Make a slice.
kono
parents:
diff changeset
87 DEF_GO_RUNTIME(MAKESLICE, "runtime.makeslice", P3(TYPE, INT, INT),
kono
parents:
diff changeset
88 R1(SLICE))
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 DEF_GO_RUNTIME(MAKESLICE64, "runtime.makeslice64", P3(TYPE, INT64, INT64),
kono
parents:
diff changeset
91 R1(SLICE))
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
94 // Make a map with a hint and an (optional, unused) map structure.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
95 DEF_GO_RUNTIME(MAKEMAP, "runtime.makemap", P3(TYPE, INT, POINTER),
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
96 R1(MAP))
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
97 DEF_GO_RUNTIME(MAKEMAP64, "runtime.makemap64", P3(TYPE, INT64, POINTER),
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
98 R1(MAP))
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
99
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
100 // Make a map with no hint, or a small constant hint.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
101 DEF_GO_RUNTIME(MAKEMAP_SMALL, "runtime.makemap_small", P0(), R1(MAP))
111
kono
parents:
diff changeset
102
kono
parents:
diff changeset
103 // Build a map from a composite literal.
kono
parents:
diff changeset
104 DEF_GO_RUNTIME(CONSTRUCT_MAP, "__go_construct_map",
kono
parents:
diff changeset
105 P5(POINTER, UINTPTR, UINTPTR, UINTPTR, POINTER),
kono
parents:
diff changeset
106 R1(MAP))
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 // Look up a key in a map.
kono
parents:
diff changeset
109 DEF_GO_RUNTIME(MAPACCESS1, "runtime.mapaccess1", P3(TYPE, MAP, POINTER),
kono
parents:
diff changeset
110 R1(POINTER))
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 // Look up a key in a map when the value is large.
kono
parents:
diff changeset
113 DEF_GO_RUNTIME(MAPACCESS1_FAT, "runtime.mapaccess1_fat",
kono
parents:
diff changeset
114 P4(TYPE, MAP, POINTER, POINTER), R1(POINTER))
kono
parents:
diff changeset
115
kono
parents:
diff changeset
116 // Look up a key in a map returning the value and whether it is
kono
parents:
diff changeset
117 // present.
kono
parents:
diff changeset
118 DEF_GO_RUNTIME(MAPACCESS2, "runtime.mapaccess2", P3(TYPE, MAP, POINTER),
kono
parents:
diff changeset
119 R2(POINTER, BOOL))
kono
parents:
diff changeset
120
kono
parents:
diff changeset
121 // Look up a key in a map, returning the value and whether it is
kono
parents:
diff changeset
122 // present, when the value is large.
kono
parents:
diff changeset
123 DEF_GO_RUNTIME(MAPACCESS2_FAT, "runtime.mapaccess2_fat",
kono
parents:
diff changeset
124 P4(TYPE, MAP, POINTER, POINTER), R2(POINTER, BOOL))
kono
parents:
diff changeset
125
kono
parents:
diff changeset
126 // Assignment to a key in a map.
kono
parents:
diff changeset
127 DEF_GO_RUNTIME(MAPASSIGN, "runtime.mapassign", P3(TYPE, MAP, POINTER),
kono
parents:
diff changeset
128 R1(POINTER))
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 // Delete a key from a map.
kono
parents:
diff changeset
131 DEF_GO_RUNTIME(MAPDELETE, "runtime.mapdelete", P3(TYPE, MAP, POINTER), R0())
kono
parents:
diff changeset
132
kono
parents:
diff changeset
133 // Begin a range over a map.
kono
parents:
diff changeset
134 DEF_GO_RUNTIME(MAPITERINIT, "runtime.mapiterinit", P3(TYPE, MAP, POINTER),
kono
parents:
diff changeset
135 R0())
kono
parents:
diff changeset
136
kono
parents:
diff changeset
137 // Range over a map, moving to the next map entry.
kono
parents:
diff changeset
138 DEF_GO_RUNTIME(MAPITERNEXT, "runtime.mapiternext", P1(POINTER), R0())
kono
parents:
diff changeset
139
kono
parents:
diff changeset
140
kono
parents:
diff changeset
141 // Make a channel.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
142 DEF_GO_RUNTIME(MAKECHAN, "runtime.makechan", P2(TYPE, INT), R1(CHAN))
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
143 DEF_GO_RUNTIME(MAKECHAN64, "runtime.makechan64", P2(TYPE, INT64), R1(CHAN))
111
kono
parents:
diff changeset
144
kono
parents:
diff changeset
145 // Send a value on a channel.
kono
parents:
diff changeset
146 DEF_GO_RUNTIME(CHANSEND, "runtime.chansend1", P2(CHAN, POINTER), R0())
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 // Receive a value from a channel.
kono
parents:
diff changeset
149 DEF_GO_RUNTIME(CHANRECV1, "runtime.chanrecv1", P2(CHAN, POINTER), R0())
kono
parents:
diff changeset
150
kono
parents:
diff changeset
151 // Receive a value from a channel returning whether it is closed.
kono
parents:
diff changeset
152 DEF_GO_RUNTIME(CHANRECV2, "runtime.chanrecv2", P2(CHAN, POINTER), R1(BOOL))
kono
parents:
diff changeset
153
kono
parents:
diff changeset
154
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
155 // Run a select, returning the index of the selected clause and
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
156 // whether that channel received a value.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
157 DEF_GO_RUNTIME(SELECTGO, "runtime.selectgo", P3(POINTER, POINTER, INT),
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
158 R2(INT, BOOL))
111
kono
parents:
diff changeset
159
kono
parents:
diff changeset
160
kono
parents:
diff changeset
161 // Panic.
kono
parents:
diff changeset
162 DEF_GO_RUNTIME(GOPANIC, "runtime.gopanic", P1(EFACE), R0())
kono
parents:
diff changeset
163
kono
parents:
diff changeset
164 // Recover.
kono
parents:
diff changeset
165 DEF_GO_RUNTIME(GORECOVER, "runtime.gorecover", P0(), R1(EFACE))
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 // Recover when called directly from defer.
kono
parents:
diff changeset
168 DEF_GO_RUNTIME(DEFERREDRECOVER, "runtime.deferredrecover", P0(), R1(EFACE))
kono
parents:
diff changeset
169
kono
parents:
diff changeset
170 // Decide whether this function can call recover.
kono
parents:
diff changeset
171 DEF_GO_RUNTIME(CANRECOVER, "runtime.canrecover", P1(POINTER), R1(BOOL))
kono
parents:
diff changeset
172
kono
parents:
diff changeset
173 // Set the return address for defer in a defer thunk.
kono
parents:
diff changeset
174 DEF_GO_RUNTIME(SETDEFERRETADDR, "runtime.setdeferretaddr", P1(POINTER),
kono
parents:
diff changeset
175 R1(BOOL))
kono
parents:
diff changeset
176
kono
parents:
diff changeset
177 // Check for a deferred function in an exception handler.
kono
parents:
diff changeset
178 DEF_GO_RUNTIME(CHECKDEFER, "runtime.checkdefer", P1(BOOLPTR), R0())
kono
parents:
diff changeset
179
kono
parents:
diff changeset
180 // Run deferred functions.
kono
parents:
diff changeset
181 DEF_GO_RUNTIME(DEFERRETURN, "runtime.deferreturn", P1(BOOLPTR), R0())
kono
parents:
diff changeset
182
kono
parents:
diff changeset
183 // Panic with a runtime error.
kono
parents:
diff changeset
184 DEF_GO_RUNTIME(RUNTIME_ERROR, "__go_runtime_error", P1(INT32), R0())
kono
parents:
diff changeset
185
kono
parents:
diff changeset
186
kono
parents:
diff changeset
187 // Close.
kono
parents:
diff changeset
188 DEF_GO_RUNTIME(CLOSE, "runtime.closechan", P1(CHAN), R0())
kono
parents:
diff changeset
189
kono
parents:
diff changeset
190
kono
parents:
diff changeset
191 // Copy.
kono
parents:
diff changeset
192 DEF_GO_RUNTIME(SLICECOPY, "runtime.slicecopy", P3(SLICE, SLICE, UINTPTR),
kono
parents:
diff changeset
193 R1(INT))
kono
parents:
diff changeset
194
kono
parents:
diff changeset
195 // Copy from string.
kono
parents:
diff changeset
196 DEF_GO_RUNTIME(SLICESTRINGCOPY, "runtime.slicestringcopy", P2(SLICE, STRING),
kono
parents:
diff changeset
197 R1(INT))
kono
parents:
diff changeset
198
kono
parents:
diff changeset
199 // Copy of value containing pointers.
kono
parents:
diff changeset
200 DEF_GO_RUNTIME(TYPEDSLICECOPY, "runtime.typedslicecopy",
kono
parents:
diff changeset
201 P3(TYPE, SLICE, SLICE), R1(INT))
kono
parents:
diff changeset
202
kono
parents:
diff changeset
203
kono
parents:
diff changeset
204 // Grow a slice for append.
kono
parents:
diff changeset
205 DEF_GO_RUNTIME(GROWSLICE, "runtime.growslice", P3(TYPE, SLICE, INT), R1(SLICE))
kono
parents:
diff changeset
206
kono
parents:
diff changeset
207
kono
parents:
diff changeset
208 // Register roots (global variables) for the garbage collector.
kono
parents:
diff changeset
209 DEF_GO_RUNTIME(REGISTER_GC_ROOTS, "runtime.registerGCRoots", P1(POINTER), R0())
kono
parents:
diff changeset
210
kono
parents:
diff changeset
211
kono
parents:
diff changeset
212 // Allocate memory.
kono
parents:
diff changeset
213 DEF_GO_RUNTIME(NEW, "runtime.newobject", P1(TYPE), R1(POINTER))
kono
parents:
diff changeset
214
kono
parents:
diff changeset
215 // Start a new goroutine.
kono
parents:
diff changeset
216 DEF_GO_RUNTIME(GO, "__go_go", P2(FUNC_PTR, POINTER), R0())
kono
parents:
diff changeset
217
kono
parents:
diff changeset
218 // Defer a function.
kono
parents:
diff changeset
219 DEF_GO_RUNTIME(DEFERPROC, "runtime.deferproc", P3(BOOLPTR, FUNC_PTR, POINTER),
kono
parents:
diff changeset
220 R0())
kono
parents:
diff changeset
221
kono
parents:
diff changeset
222
kono
parents:
diff changeset
223 // Convert an empty interface to an empty interface, returning ok.
kono
parents:
diff changeset
224 DEF_GO_RUNTIME(IFACEE2E2, "runtime.ifaceE2E2", P1(EFACE), R2(EFACE, BOOL))
kono
parents:
diff changeset
225
kono
parents:
diff changeset
226 // Convert a non-empty interface to an empty interface, returning ok.
kono
parents:
diff changeset
227 DEF_GO_RUNTIME(IFACEI2E2, "runtime.ifaceI2E2", P1(IFACE), R2(EFACE, BOOL))
kono
parents:
diff changeset
228
kono
parents:
diff changeset
229 // Convert an empty interface to a non-empty interface, returning ok.
kono
parents:
diff changeset
230 DEF_GO_RUNTIME(IFACEE2I2, "runtime.ifaceE2I2", P2(TYPE, EFACE),
kono
parents:
diff changeset
231 R2(IFACE, BOOL))
kono
parents:
diff changeset
232
kono
parents:
diff changeset
233 // Convert a non-empty interface to a non-empty interface, returning ok.
kono
parents:
diff changeset
234 DEF_GO_RUNTIME(IFACEI2I2, "runtime.ifaceI2I2", P2(TYPE, IFACE),
kono
parents:
diff changeset
235 R2(IFACE, BOOL))
kono
parents:
diff changeset
236
kono
parents:
diff changeset
237 // Convert an empty interface to a pointer type, returning ok.
kono
parents:
diff changeset
238 DEF_GO_RUNTIME(IFACEE2T2P, "runtime.ifaceE2T2P", P2(TYPE, EFACE),
kono
parents:
diff changeset
239 R2(POINTER, BOOL))
kono
parents:
diff changeset
240
kono
parents:
diff changeset
241 // Convert a non-empty interface to a pointer type, return ok.
kono
parents:
diff changeset
242 DEF_GO_RUNTIME(IFACEI2T2P, "runtime.ifaceI2T2P", P2(TYPE, IFACE),
kono
parents:
diff changeset
243 R2(POINTER, BOOL))
kono
parents:
diff changeset
244
kono
parents:
diff changeset
245 // Convert an empty interface to a non-pointer type, returning ok.
kono
parents:
diff changeset
246 DEF_GO_RUNTIME(IFACEE2T2, "runtime.ifaceE2T2", P3(TYPE, EFACE, POINTER),
kono
parents:
diff changeset
247 R1(BOOL))
kono
parents:
diff changeset
248
kono
parents:
diff changeset
249 // Convert a non-empty interface to a non-pointer type, returning ok.
kono
parents:
diff changeset
250 DEF_GO_RUNTIME(IFACEI2T2, "runtime.ifaceI2T2", P3(TYPE, IFACE, POINTER),
kono
parents:
diff changeset
251 R1(BOOL))
kono
parents:
diff changeset
252
kono
parents:
diff changeset
253 // Return the interface method table for the second type converted to
kono
parents:
diff changeset
254 // the first type which is a (possibly empty) interface type. Panics
kono
parents:
diff changeset
255 // if the second type is nil (indicating a nil interface value) or if
kono
parents:
diff changeset
256 // the conversion is not possible. Used for type assertions. This is
kono
parents:
diff changeset
257 // like REQUIREITAB, but for type assertions.
kono
parents:
diff changeset
258 DEF_GO_RUNTIME(ASSERTITAB, "runtime.assertitab", P2(TYPE, TYPE), R1(POINTER))
kono
parents:
diff changeset
259
kono
parents:
diff changeset
260 // Return the interface method table for the second type converted to
kono
parents:
diff changeset
261 // the first type, which is a non-empty interface type. Return nil if
kono
parents:
diff changeset
262 // the second type is nil, indicating a nil interface value. Panics
kono
parents:
diff changeset
263 // if the conversion is not possible. Used for assignments. This is
kono
parents:
diff changeset
264 // like ASSERTITAB, but for assignments.
kono
parents:
diff changeset
265 DEF_GO_RUNTIME(REQUIREITAB, "runtime.requireitab", P2(TYPE, TYPE),
kono
parents:
diff changeset
266 R1(POINTER))
kono
parents:
diff changeset
267
kono
parents:
diff changeset
268 // Check whether an interface type may be converted to a
kono
parents:
diff changeset
269 // non-interface type.
kono
parents:
diff changeset
270 DEF_GO_RUNTIME(ASSERTI2T, "runtime.assertI2T", P3(TYPE, TYPE, TYPE), R0())
kono
parents:
diff changeset
271
kono
parents:
diff changeset
272 // Return whether we can convert a type to an interface type.
kono
parents:
diff changeset
273 DEF_GO_RUNTIME(IFACET2IP, "runtime.ifaceT2Ip", P2(TYPE, TYPE), R1(BOOL))
kono
parents:
diff changeset
274
kono
parents:
diff changeset
275 // Get the type descriptor of an empty interface.
kono
parents:
diff changeset
276 DEF_GO_RUNTIME(EFACETYPE, "runtime.efacetype", P1(EFACE), R1(TYPE))
kono
parents:
diff changeset
277
kono
parents:
diff changeset
278 // Get the type descriptor of a non-empty interface.
kono
parents:
diff changeset
279 DEF_GO_RUNTIME(IFACETYPE, "runtime.ifacetype", P1(IFACE), R1(TYPE))
kono
parents:
diff changeset
280
kono
parents:
diff changeset
281
kono
parents:
diff changeset
282 // Compare two type descriptors for equality.
kono
parents:
diff changeset
283 DEF_GO_RUNTIME(IFACETYPEEQ, "runtime.ifacetypeeq", P2(TYPE, TYPE), R1(BOOL))
kono
parents:
diff changeset
284
kono
parents:
diff changeset
285 // Compare two empty interface values.
kono
parents:
diff changeset
286 DEF_GO_RUNTIME(EFACEEQ, "runtime.efaceeq", P2(EFACE, EFACE), R1(BOOL))
kono
parents:
diff changeset
287
kono
parents:
diff changeset
288 // Compare an empty interface value to a non-interface value.
kono
parents:
diff changeset
289 DEF_GO_RUNTIME(EFACEVALEQ, "runtime.efacevaleq", P3(EFACE, TYPE, POINTER),
kono
parents:
diff changeset
290 R1(BOOL))
kono
parents:
diff changeset
291
kono
parents:
diff changeset
292 // Compare two non-empty interface values.
kono
parents:
diff changeset
293 DEF_GO_RUNTIME(IFACEEQ, "runtime.ifaceeq", P2(IFACE, IFACE), R1(BOOL))
kono
parents:
diff changeset
294
kono
parents:
diff changeset
295 // Compare a non-empty interface value to a non-interface value.
kono
parents:
diff changeset
296 DEF_GO_RUNTIME(IFACEVALEQ, "runtime.ifacevaleq", P3(IFACE, TYPE, POINTER),
kono
parents:
diff changeset
297 R1(BOOL))
kono
parents:
diff changeset
298
kono
parents:
diff changeset
299 // Compare a non-empty interface value to an interface value.
kono
parents:
diff changeset
300 DEF_GO_RUNTIME(IFACEEFACEEQ, "runtime.ifaceefaceeq", P2(IFACE, EFACE),
kono
parents:
diff changeset
301 R1(BOOL))
kono
parents:
diff changeset
302
kono
parents:
diff changeset
303
kono
parents:
diff changeset
304 // Set *dst = src where dst is a pointer to a pointer and src is a pointer.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
305 DEF_GO_RUNTIME(GCWRITEBARRIER, "runtime.gcWriteBarrier",
111
kono
parents:
diff changeset
306 P2(POINTER, POINTER), R0())
kono
parents:
diff changeset
307
kono
parents:
diff changeset
308 // Set *dst = *src for an arbitrary type.
kono
parents:
diff changeset
309 DEF_GO_RUNTIME(TYPEDMEMMOVE, "runtime.typedmemmove",
kono
parents:
diff changeset
310 P3(TYPE, POINTER, POINTER), R0())
kono
parents:
diff changeset
311
kono
parents:
diff changeset
312
kono
parents:
diff changeset
313 // Lock the printer (for print/println).
kono
parents:
diff changeset
314 DEF_GO_RUNTIME(PRINTLOCK, "runtime.printlock", P0(), R0())
kono
parents:
diff changeset
315
kono
parents:
diff changeset
316 // Unlock the printer (for print/println).
kono
parents:
diff changeset
317 DEF_GO_RUNTIME(PRINTUNLOCK, "runtime.printunlock", P0(), R0())
kono
parents:
diff changeset
318
kono
parents:
diff changeset
319 // Print a string (for print/println).
kono
parents:
diff changeset
320 DEF_GO_RUNTIME(PRINTSTRING, "runtime.printstring", P1(STRING), R0())
kono
parents:
diff changeset
321
kono
parents:
diff changeset
322 // Print a uint64 (for print/println).
kono
parents:
diff changeset
323 DEF_GO_RUNTIME(PRINTUINT, "runtime.printuint", P1(UINT64), R0())
kono
parents:
diff changeset
324
kono
parents:
diff changeset
325 // Print a int64 (for print/println).
kono
parents:
diff changeset
326 DEF_GO_RUNTIME(PRINTINT, "runtime.printint", P1(INT64), R0())
kono
parents:
diff changeset
327
kono
parents:
diff changeset
328 // Print a float64 (for print/println).
kono
parents:
diff changeset
329 DEF_GO_RUNTIME(PRINTFLOAT, "runtime.printfloat", P1(FLOAT64), R0())
kono
parents:
diff changeset
330
kono
parents:
diff changeset
331 // Print a complex128 (for print/println).
kono
parents:
diff changeset
332 DEF_GO_RUNTIME(PRINTCOMPLEX, "runtime.printcomplex", P1(COMPLEX128), R0())
kono
parents:
diff changeset
333
kono
parents:
diff changeset
334 // Print a bool (for print/println).
kono
parents:
diff changeset
335 DEF_GO_RUNTIME(PRINTBOOL, "runtime.printbool", P1(BOOL), R0())
kono
parents:
diff changeset
336
kono
parents:
diff changeset
337 // Print a pointer/map/channel/function (for print/println).
kono
parents:
diff changeset
338 DEF_GO_RUNTIME(PRINTPOINTER, "runtime.printpointer", P1(POINTER), R0())
kono
parents:
diff changeset
339
kono
parents:
diff changeset
340 // Print an empty interface (for print/println).
kono
parents:
diff changeset
341 DEF_GO_RUNTIME(PRINTEFACE, "runtime.printeface", P1(EFACE), R0())
kono
parents:
diff changeset
342
kono
parents:
diff changeset
343 // Print a non-empty interface (for print/println).
kono
parents:
diff changeset
344 DEF_GO_RUNTIME(PRINTIFACE, "runtime.printiface", P1(IFACE), R0())
kono
parents:
diff changeset
345
kono
parents:
diff changeset
346 // Print a slice (for print/println).
kono
parents:
diff changeset
347 DEF_GO_RUNTIME(PRINTSLICE, "runtime.printslice", P1(SLICE), R0())
kono
parents:
diff changeset
348
kono
parents:
diff changeset
349 // Print a space (for println).
kono
parents:
diff changeset
350 DEF_GO_RUNTIME(PRINTSP, "runtime.printsp", P0(), R0())
kono
parents:
diff changeset
351
kono
parents:
diff changeset
352 // Print a newline (for println).
kono
parents:
diff changeset
353 DEF_GO_RUNTIME(PRINTNL, "runtime.printnl", P0(), R0())
kono
parents:
diff changeset
354
kono
parents:
diff changeset
355
kono
parents:
diff changeset
356 // Used for field tracking for data analysis.
kono
parents:
diff changeset
357 DEF_GO_RUNTIME(FIELDTRACK, "__go_fieldtrack", P1(POINTER), R0())
kono
parents:
diff changeset
358
kono
parents:
diff changeset
359
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
360 // Unreachable code.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
361 DEF_GO_RUNTIME(UNREACHABLE, "__builtin_unreachable", P0(), R0())
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
362
111
kono
parents:
diff changeset
363 // Remove helper macros.
kono
parents:
diff changeset
364 #undef ABFT6
kono
parents:
diff changeset
365 #undef ABFT2
kono
parents:
diff changeset
366 #undef P0
kono
parents:
diff changeset
367 #undef P1
kono
parents:
diff changeset
368 #undef P2
kono
parents:
diff changeset
369 #undef P3
kono
parents:
diff changeset
370 #undef P4
kono
parents:
diff changeset
371 #undef P5
kono
parents:
diff changeset
372 #undef P6
kono
parents:
diff changeset
373 #undef R0
kono
parents:
diff changeset
374 #undef R1
kono
parents:
diff changeset
375 #undef R2