codegen: improve the generated code on architectures with flags
[ajla.git] / ipret.h
blobf9a22bbcf95cbecb136fe67776ef78ed291c0cc0
1 /*
2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
9 * version.
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
19 #ifndef AJLA_IPRET_H
20 #define AJLA_IPRET_H
22 #include "data.h"
24 #define run name(run)
25 #define cg_upcall_vector name(cg_upcall_vector)
27 /*#define DEBUG_UPCALL*/
29 #ifdef POINTER_COMPRESSION
30 #define pointer_t_upcall uintptr_t
31 #define int_default_t_upcall intptr_t
32 #else
33 #define pointer_t_upcall pointer_t
34 #define int_default_t_upcall int_default_t
35 #endif
37 void attr_fastcall run(frame_s *, ip_t);
39 struct cg_upcall_vector_s {
40 atomic_type tick_stamp_t ts;
41 #ifdef HAVE_CODEGEN
42 void (*mem_copy)(void *dest, const void *src, size_t size);
43 void (*mem_clear)(void *ptr, size_t size);
44 void (*cg_upcall_pointer_dereference)(pointer_t_upcall ptr);
45 void (*cg_upcall_pointer_reference_owned)(pointer_t_upcall ptr);
46 pointer_t (*cg_upcall_flat_to_data)(frame_s *fp, uintptr_t slot, const unsigned char *flat);
47 unsigned char *(*cg_upcall_data_alloc_function_reference_mayfail)(uintptr_t n_curried_arguments);
48 unsigned char *(*cg_upcall_data_alloc_record_mayfail)(frame_s *fp, uintptr_t slot);
49 unsigned char *(*cg_upcall_data_alloc_option_mayfail)(void);
50 unsigned char *(*cg_upcall_data_alloc_array_flat_tag_mayfail)(uintptr_t t, int_default_t_upcall n_entries);
51 unsigned char *(*cg_upcall_data_alloc_array_flat_slot_mayfail)(frame_s *fp, uintptr_t slot, int_default_t_upcall n_entries);
52 unsigned char *(*cg_upcall_data_alloc_array_flat_types_ptr_mayfail)(frame_s *fp, uintptr_t local_type, int_default_t_upcall n_entries);
53 unsigned char *(*cg_upcall_data_alloc_array_pointers_mayfail)(int_default_t_upcall n_allocated, int_default_t_upcall n_used);
54 pointer_t (*cg_upcall_array_create_flat)(frame_s *fp, int_default_t_upcall length, uintptr_t content_slot);
55 pointer_t (*cg_upcall_array_create_pointers)(frame_s *fp, uintptr_t ip_offset, uintptr_t length_slot, pointer_t_upcall ptr);
56 pointer_t (*cg_upcall_array_create_sparse)(int_default_t_upcall length, pointer_t_upcall ptr);
57 pointer_t (*cg_upcall_array_sub)(pointer_t_upcall array, int_default_t_upcall start, int_default_t_upcall end, bool deref);
58 pointer_t (*cg_upcall_array_skip)(pointer_t_upcall array, int_default_t_upcall start, bool deref);
59 pointer_t (*cg_upcall_array_join)(pointer_t_upcall ptr1, pointer_t_upcall ptr2);
60 void *(*cg_upcall_ipret_io)(frame_s *fp, uintptr_t ip_offset, uintptr_t code_params);
61 pointer_t (*cg_upcall_ipret_copy_variable_to_pointer)(frame_s *src_fp, uintptr_t src_slot, bool deref);
62 int_default_t (*cg_upcall_ipret_system_property)(int_default_t_upcall idx);
63 #define f(n, s, u, sz, bits) \
64 bool (*cat(INT_binary_const_,s))(const s *v1, int_default_t_upcall v2, s *r, bool (*op)(const void *, const void *, void *));
65 for_all_int(f, for_all_empty)
66 #undef f
67 bool (*cat(FIXED_binary_add_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
68 bool (*cat(FIXED_binary_subtract_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
69 #define f(n, s, u, sz, bits) \
70 bool (*cat(FIXED_binary_multiply_,s))(const u *v1, const u *v2, u *r);
71 for_all_fixed(f)
72 #undef f
73 #define f(n, s, u, sz, bits) \
74 bool (*cat(FIXED_binary_divide_,s))(const u *v1, const u *v2, u *r);
75 for_all_fixed(f)
76 #undef f
77 #define f(n, s, u, sz, bits) \
78 bool (*cat(FIXED_binary_udivide_,s))(const u *v1, const u *v2, u *r);
79 for_all_fixed(f)
80 #undef f
81 #define f(n, s, u, sz, bits) \
82 bool (*cat(FIXED_binary_modulo_,s))(const u *v1, const u *v2, u *r);
83 for_all_fixed(f)
84 #undef f
85 #define f(n, s, u, sz, bits) \
86 bool (*cat(FIXED_binary_umodulo_,s))(const u *v1, const u *v2, u *r);
87 for_all_fixed(f)
88 #undef f
89 #define f(n, s, u, sz, bits) \
90 bool (*cat(FIXED_binary_power_,s))(const u *v1, const u *v2, u *r);
91 for_all_fixed(f)
92 #undef f
93 bool (*cat(FIXED_binary_shl_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
94 bool (*cat(FIXED_binary_shr_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
95 bool (*cat(FIXED_binary_ushr_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
96 bool (*cat(FIXED_binary_rol_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
97 bool (*cat(FIXED_binary_ror_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
98 bool (*cat(FIXED_binary_bts_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
99 bool (*cat(FIXED_binary_btr_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
100 bool (*cat(FIXED_binary_btc_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
101 bool (*cat(FIXED_binary_less_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
102 bool (*cat(FIXED_binary_less_equal_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
103 bool (*cat(FIXED_binary_uless_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
104 bool (*cat(FIXED_binary_uless_equal_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
105 bool (*cat(FIXED_binary_bt_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
106 void (*cat(FIXED_unary_neg_,TYPE_INT_MAX))(const uintbig_t *v1, uintbig_t *r);
107 void (*cat(FIXED_unary_inc_,TYPE_INT_MAX))(const uintbig_t *v1, uintbig_t *r);
108 void (*cat(FIXED_unary_dec_,TYPE_INT_MAX))(const uintbig_t *v1, uintbig_t *r);
109 #define f(n, s, u, sz, bits) \
110 void (*cat(FIXED_unary_bswap_,s))(const u *v1, u *r);
111 for_all_fixed(f)
112 #undef f
113 #define f(n, s, u, sz, bits) \
114 void (*cat(FIXED_unary_brev_,s))(const u *v1, u *r);
115 for_all_fixed(f)
116 #undef f
117 #define f(n, s, u, sz, bits) \
118 void (*cat(FIXED_unary_bsf_,s))(const u *v1, u *r);
119 for_all_fixed(f)
120 #undef f
121 #define f(n, s, u, sz, bits) \
122 void (*cat(FIXED_unary_bsr_,s))(const u *v1, u *r);
123 for_all_fixed(f)
124 #undef f
125 #define f(n, s, u, sz, bits) \
126 void (*cat(FIXED_unary_popcnt_,s))(const u *v1, u *r);
127 for_all_fixed(f)
128 #undef f
129 #define f(n, s, u, sz, bits) \
130 bool (*cat(FIXED_uto_int_,s))(const u *v1, int_default_t *r);
131 for_all_fixed(f)
132 #undef f
133 #define f(n, s, u, sz, bits) \
134 bool (*cat(FIXED_ufrom_int_,s))(const int_default_t *v1, u *r);
135 for_all_fixed(f)
136 #undef f
137 bool (*cat(INT_binary_add_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
138 bool (*cat(INT_binary_subtract_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
139 #define f(n, s, u, sz, bits) \
140 bool (*cat(INT_binary_multiply_,s))(const s *v1, const s *v2, s *r);
141 for_all_int(f, for_all_empty)
142 #undef f
143 #define f(n, s, u, sz, bits) \
144 bool (*cat(INT_binary_divide_,s))(const s *v1, const s *v2, s *r);
145 for_all_int(f, for_all_empty)
146 #undef f
147 #define f(n, s, u, sz, bits) \
148 bool (*cat(INT_binary_modulo_,s))(const s *v1, const s *v2, s *r);
149 for_all_int(f, for_all_empty)
150 #undef f
151 #define f(n, s, u, sz, bits) \
152 bool (*cat(INT_binary_power_,s))(const s *v1, const s *v2, s *r);
153 for_all_int(f, for_all_empty)
154 #undef f
155 bool (*cat(INT_binary_shl_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
156 bool (*cat(INT_binary_shr_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
157 bool (*cat(INT_binary_bts_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
158 bool (*cat(INT_binary_btr_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
159 bool (*cat(INT_binary_btc_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
160 bool (*cat(INT_binary_bt_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, ajla_flat_option_t *r);
161 bool (*cat(INT_unary_neg_,TYPE_INT_MAX))(const intbig_t *v1, intbig_t *r);
162 bool (*cat(INT_unary_inc_,TYPE_INT_MAX))(const intbig_t *v1, intbig_t *r);
163 bool (*cat(INT_unary_dec_,TYPE_INT_MAX))(const intbig_t *v1, intbig_t *r);
164 #define f(n, s, u, sz, bits) \
165 bool (*cat(INT_unary_bsf_,s))(const s *v1, s *r);
166 for_all_int(f, for_all_empty)
167 #undef f
168 #define f(n, s, u, sz, bits) \
169 bool (*cat(INT_unary_bsr_,s))(const s *v1, s *r);
170 for_all_int(f, for_all_empty)
171 #undef f
172 #define f(n, s, u, sz, bits) \
173 bool (*cat(INT_unary_popcnt_,s))(const s *v1, s *r);
174 for_all_int(f, for_all_empty)
175 #undef f
176 #define f(n, t, nt, pack, unpack) \
177 bool (*cat(REAL_binary_add_,t))(const t *v1, const t *v2, t *r);
178 #define nf(n, t) \
179 void (*cat(REAL_binary_add_,t))(void);
180 for_all_real(f, nf)
181 #undef f
182 #undef nf
183 #define f(n, t, nt, pack, unpack) \
184 bool (*cat(REAL_binary_subtract_,t))(const t *v1, const t *v2, t *r);
185 #define nf(n, t) \
186 void (*cat(REAL_binary_subtract_,t))(void);
187 for_all_real(f, nf)
188 #undef f
189 #undef nf
190 #define f(n, t, nt, pack, unpack) \
191 bool (*cat(REAL_binary_multiply_,t))(const t *v1, const t *v2, t *r);
192 #define nf(n, t) \
193 void (*cat(REAL_binary_multiply_,t))(void);
194 for_all_real(f, nf)
195 #undef f
196 #undef nf
197 #define f(n, t, nt, pack, unpack) \
198 bool (*cat(REAL_binary_divide_,t))(const t *v1, const t *v2, t *r);
199 #define nf(n, t) \
200 void (*cat(REAL_binary_divide_,t))(void);
201 for_all_real(f, nf)
202 #undef f
203 #undef nf
204 #define f(n, t, nt, pack, unpack) \
205 bool (*cat(REAL_binary_modulo_,t))(const t *v1, const t *v2, t *r);
206 #define nf(n, t) \
207 void (*cat(REAL_binary_modulo_,t))(void);
208 for_all_real(f, nf)
209 #undef f
210 #undef nf
211 #define f(n, t, nt, pack, unpack) \
212 bool (*cat(REAL_binary_power_,t))(const t *v1, const t *v2, t *r);
213 #define nf(n, t) \
214 void (*cat(REAL_binary_power_,t))(void);
215 for_all_real(f, nf)
216 #undef f
217 #undef nf
218 #define f(n, t, nt, pack, unpack) \
219 bool (*cat(REAL_binary_ldexp_,t))(const t *v1, const t *v2, t *r);
220 #define nf(n, t) \
221 void (*cat(REAL_binary_ldexp_,t))(void);
222 for_all_real(f, nf)
223 #undef f
224 #undef nf
225 #define f(n, t, nt, pack, unpack) \
226 bool (*cat(REAL_binary_atan2_,t))(const t *v1, const t *v2, t *r);
227 #define nf(n, t) \
228 void (*cat(REAL_binary_atan2_,t))(void);
229 for_all_real(f, nf)
230 #undef f
231 #undef nf
232 #define f(n, t, nt, pack, unpack) \
233 bool (*cat(REAL_binary_equal_,t))(const t *v1, const t *v2, ajla_flat_option_t *r);
234 #define nf(n, t) \
235 void (*cat(REAL_binary_equal_,t))(void);
236 for_all_real(f, nf)
237 #undef f
238 #undef nf
239 #define f(n, t, nt, pack, unpack) \
240 bool (*cat(REAL_binary_not_equal_,t))(const t *v1, const t *v2, ajla_flat_option_t *r);
241 #define nf(n, t) \
242 void (*cat(REAL_binary_not_equal_,t))(void);
243 for_all_real(f, nf)
244 #undef f
245 #undef nf
246 #define f(n, t, nt, pack, unpack) \
247 bool (*cat(REAL_binary_less_,t))(const t *v1, const t *v2, ajla_flat_option_t *r);
248 #define nf(n, t) \
249 void (*cat(REAL_binary_less_,t))(void);
250 for_all_real(f, nf)
251 #undef f
252 #undef nf
253 #define f(n, t, nt, pack, unpack) \
254 bool (*cat(REAL_binary_less_equal_,t))(const t *v1, const t *v2, ajla_flat_option_t *r);
255 #define nf(n, t) \
256 void (*cat(REAL_binary_less_equal_,t))(void);
257 for_all_real(f, nf)
258 #undef f
259 #undef nf
260 #define f(n, t, nt, pack, unpack) \
261 void (*cat(REAL_unary_neg_,t))(const t *v1, t *r);
262 #define nf(n, t) \
263 void (*cat(REAL_unary_neg_,t))(void);
264 for_all_real(f, nf)
265 #undef f
266 #undef nf
267 #define f(n, t, nt, pack, unpack) \
268 void (*cat(REAL_unary_sqrt_,t))(const t *v1, t *r);
269 #define nf(n, t) \
270 void (*cat(REAL_unary_sqrt_,t))(void);
271 for_all_real(f, nf)
272 #undef f
273 #undef nf
274 #define f(n, t, nt, pack, unpack) \
275 void (*cat(REAL_unary_cbrt_,t))(const t *v1, t *r);
276 #define nf(n, t) \
277 void (*cat(REAL_unary_cbrt_,t))(void);
278 for_all_real(f, nf)
279 #undef f
280 #undef nf
281 #define f(n, t, nt, pack, unpack) \
282 void (*cat(REAL_unary_sin_,t))(const t *v1, t *r);
283 #define nf(n, t) \
284 void (*cat(REAL_unary_sin_,t))(void);
285 for_all_real(f, nf)
286 #undef f
287 #undef nf
288 #define f(n, t, nt, pack, unpack) \
289 void (*cat(REAL_unary_cos_,t))(const t *v1, t *r);
290 #define nf(n, t) \
291 void (*cat(REAL_unary_cos_,t))(void);
292 for_all_real(f, nf)
293 #undef f
294 #undef nf
295 #define f(n, t, nt, pack, unpack) \
296 void (*cat(REAL_unary_tan_,t))(const t *v1, t *r);
297 #define nf(n, t) \
298 void (*cat(REAL_unary_tan_,t))(void);
299 for_all_real(f, nf)
300 #undef f
301 #undef nf
302 #define f(n, t, nt, pack, unpack) \
303 void (*cat(REAL_unary_asin_,t))(const t *v1, t *r);
304 #define nf(n, t) \
305 void (*cat(REAL_unary_asin_,t))(void);
306 for_all_real(f, nf)
307 #undef f
308 #undef nf
309 #define f(n, t, nt, pack, unpack) \
310 void (*cat(REAL_unary_acos_,t))(const t *v1, t *r);
311 #define nf(n, t) \
312 void (*cat(REAL_unary_acos_,t))(void);
313 for_all_real(f, nf)
314 #undef f
315 #undef nf
316 #define f(n, t, nt, pack, unpack) \
317 void (*cat(REAL_unary_atan_,t))(const t *v1, t *r);
318 #define nf(n, t) \
319 void (*cat(REAL_unary_atan_,t))(void);
320 for_all_real(f, nf)
321 #undef f
322 #undef nf
323 #define f(n, t, nt, pack, unpack) \
324 void (*cat(REAL_unary_sinh_,t))(const t *v1, t *r);
325 #define nf(n, t) \
326 void (*cat(REAL_unary_sinh_,t))(void);
327 for_all_real(f, nf)
328 #undef f
329 #undef nf
330 #define f(n, t, nt, pack, unpack) \
331 void (*cat(REAL_unary_cosh_,t))(const t *v1, t *r);
332 #define nf(n, t) \
333 void (*cat(REAL_unary_cosh_,t))(void);
334 for_all_real(f, nf)
335 #undef f
336 #undef nf
337 #define f(n, t, nt, pack, unpack) \
338 void (*cat(REAL_unary_tanh_,t))(const t *v1, t *r);
339 #define nf(n, t) \
340 void (*cat(REAL_unary_tanh_,t))(void);
341 for_all_real(f, nf)
342 #undef f
343 #undef nf
344 #define f(n, t, nt, pack, unpack) \
345 void (*cat(REAL_unary_asinh_,t))(const t *v1, t *r);
346 #define nf(n, t) \
347 void (*cat(REAL_unary_asinh_,t))(void);
348 for_all_real(f, nf)
349 #undef f
350 #undef nf
351 #define f(n, t, nt, pack, unpack) \
352 void (*cat(REAL_unary_acosh_,t))(const t *v1, t *r);
353 #define nf(n, t) \
354 void (*cat(REAL_unary_acosh_,t))(void);
355 for_all_real(f, nf)
356 #undef f
357 #undef nf
358 #define f(n, t, nt, pack, unpack) \
359 void (*cat(REAL_unary_atanh_,t))(const t *v1, t *r);
360 #define nf(n, t) \
361 void (*cat(REAL_unary_atanh_,t))(void);
362 for_all_real(f, nf)
363 #undef f
364 #undef nf
365 #define f(n, t, nt, pack, unpack) \
366 void (*cat(REAL_unary_exp2_,t))(const t *v1, t *r);
367 #define nf(n, t) \
368 void (*cat(REAL_unary_exp2_,t))(void);
369 for_all_real(f, nf)
370 #undef f
371 #undef nf
372 #define f(n, t, nt, pack, unpack) \
373 void (*cat(REAL_unary_exp_,t))(const t *v1, t *r);
374 #define nf(n, t) \
375 void (*cat(REAL_unary_exp_,t))(void);
376 for_all_real(f, nf)
377 #undef f
378 #undef nf
379 #define f(n, t, nt, pack, unpack) \
380 void (*cat(REAL_unary_exp10_,t))(const t *v1, t *r);
381 #define nf(n, t) \
382 void (*cat(REAL_unary_exp10_,t))(void);
383 for_all_real(f, nf)
384 #undef f
385 #undef nf
386 #define f(n, t, nt, pack, unpack) \
387 void (*cat(REAL_unary_log2_,t))(const t *v1, t *r);
388 #define nf(n, t) \
389 void (*cat(REAL_unary_log2_,t))(void);
390 for_all_real(f, nf)
391 #undef f
392 #undef nf
393 #define f(n, t, nt, pack, unpack) \
394 void (*cat(REAL_unary_log_,t))(const t *v1, t *r);
395 #define nf(n, t) \
396 void (*cat(REAL_unary_log_,t))(void);
397 for_all_real(f, nf)
398 #undef f
399 #undef nf
400 #define f(n, t, nt, pack, unpack) \
401 void (*cat(REAL_unary_log10_,t))(const t *v1, t *r);
402 #define nf(n, t) \
403 void (*cat(REAL_unary_log10_,t))(void);
404 for_all_real(f, nf)
405 #undef f
406 #undef nf
407 #define f(n, t, nt, pack, unpack) \
408 void (*cat(REAL_unary_round_,t))(const t *v1, t *r);
409 #define nf(n, t) \
410 void (*cat(REAL_unary_round_,t))(void);
411 for_all_real(f, nf)
412 #undef f
413 #undef nf
414 #define f(n, t, nt, pack, unpack) \
415 void (*cat(REAL_unary_ceil_,t))(const t *v1, t *r);
416 #define nf(n, t) \
417 void (*cat(REAL_unary_ceil_,t))(void);
418 for_all_real(f, nf)
419 #undef f
420 #undef nf
421 #define f(n, t, nt, pack, unpack) \
422 void (*cat(REAL_unary_floor_,t))(const t *v1, t *r);
423 #define nf(n, t) \
424 void (*cat(REAL_unary_floor_,t))(void);
425 for_all_real(f, nf)
426 #undef f
427 #undef nf
428 #define f(n, t, nt, pack, unpack) \
429 void (*cat(REAL_unary_trunc_,t))(const t *v1, t *r);
430 #define nf(n, t) \
431 void (*cat(REAL_unary_trunc_,t))(void);
432 for_all_real(f, nf)
433 #undef f
434 #undef nf
435 #define f(n, t, nt, pack, unpack) \
436 void (*cat(REAL_unary_fract_,t))(const t *v1, t *r);
437 #define nf(n, t) \
438 void (*cat(REAL_unary_fract_,t))(void);
439 for_all_real(f, nf)
440 #undef f
441 #undef nf
442 #define f(n, t, nt, pack, unpack) \
443 void (*cat(REAL_unary_mantissa_,t))(const t *v1, t *r);
444 #define nf(n, t) \
445 void (*cat(REAL_unary_mantissa_,t))(void);
446 for_all_real(f, nf)
447 #undef f
448 #undef nf
449 #define f(n, t, nt, pack, unpack) \
450 void (*cat(REAL_unary_exponent_,t))(const t *v1, t *r);
451 #define nf(n, t) \
452 void (*cat(REAL_unary_exponent_,t))(void);
453 for_all_real(f, nf)
454 #undef f
455 #undef nf
456 #define f(n, t, nt, pack, unpack) \
457 void (*cat(REAL_unary_next_number_,t))(const t *v1, t *r);
458 #define nf(n, t) \
459 void (*cat(REAL_unary_next_number_,t))(void);
460 for_all_real(f, nf)
461 #undef f
462 #undef nf
463 #define f(n, t, nt, pack, unpack) \
464 void (*cat(REAL_unary_prev_number_,t))(const t *v1, t *r);
465 #define nf(n, t) \
466 void (*cat(REAL_unary_prev_number_,t))(void);
467 for_all_real(f, nf)
468 #undef f
469 #undef nf
470 #define f(n, t, nt, pack, unpack) \
471 bool (*cat(REAL_unary_to_int_,t))(const t *val, int_default_t *r);
472 #define nf(n, t) \
473 void (*cat(REAL_unary_to_int_,t))(void);
474 for_all_real(f, nf)
475 #undef f
476 #undef nf
477 #define f(n, t, nt, pack, unpack) \
478 void (*cat(REAL_unary_from_int_,t))(const int_default_t *val, t *r);
479 #define nf(n, t) \
480 void (*cat(REAL_unary_from_int_,t))(void);
481 for_all_real(f, nf)
482 #undef f
483 #undef nf
484 #define f(n, t, nt, pack, unpack) \
485 void (*cat(REAL_unary_is_exception_,t))(const t *v1, ajla_flat_option_t *r);
486 #define nf(n, t) \
487 void (*cat(REAL_unary_is_exception_,t))(void);
488 for_all_real(f, nf)
489 #undef f
490 #undef nf
491 #endif
492 #ifdef DEBUG_UPCALL
493 void (*cg_upcall_debug)(unsigned long x1, unsigned long x2, unsigned long x3, unsigned long x4);
494 #endif
497 #undef nf
499 extern struct cg_upcall_vector_s cg_upcall_vector;
501 #define tick_stamp (cg_upcall_vector.ts)
503 #endif