rework the verifier to prepare for loop cutting
[ajla.git] / ipret.h
blob4dc90b3e6860d5eee7642f91b069133ff5d671aa
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)
26 #define hacked_upcall_map name(hacked_upcall_map)
28 /*#define DEBUG_UPCALL*/
30 #ifdef POINTER_COMPRESSION
31 #define pointer_t_upcall uintptr_t
32 #define int_default_t_upcall intptr_t
33 #else
34 #define pointer_t_upcall pointer_t
35 #define int_default_t_upcall int_default_t
36 #endif
38 void attr_fastcall run(frame_s *, ip_t);
40 extern uint32_t hacked_upcall_map;
42 struct cg_upcall_vector_s {
43 atomic_type tick_stamp_t ts;
44 #ifdef HAVE_CODEGEN
45 void (*mem_copy)(void *dest, const void *src, size_t size);
46 void (*mem_clear)(void *ptr, size_t size);
47 void (*cg_upcall_pointer_dereference)(pointer_t_upcall ptr);
48 void (*cg_upcall_pointer_reference_owned)(pointer_t_upcall ptr);
49 pointer_t (*cg_upcall_ipret_copy_variable_to_pointer_noderef)(frame_s *src_fp, uintptr_t src_slot);
50 pointer_t (*cg_upcall_ipret_copy_variable_to_pointer_deref)(frame_s *src_fp, uintptr_t src_slot);
51 pointer_t (*cg_upcall_flat_to_data)(frame_s *fp, uintptr_t slot);
52 unsigned char *(*cg_upcall_data_alloc_function_reference_mayfail)(uintptr_t n_curried_arguments);
53 unsigned char *(*cg_upcall_data_alloc_record_mayfail)(frame_s *fp, uintptr_t slot);
54 unsigned char *(*cg_upcall_data_alloc_option_mayfail)(void);
55 unsigned char *(*cg_upcall_data_alloc_array_flat_tag_mayfail)(uintptr_t t, int_default_t_upcall n_entries);
56 unsigned char *(*cg_upcall_data_alloc_array_flat_slot_mayfail)(frame_s *fp, uintptr_t slot, int_default_t_upcall n_entries);
57 unsigned char *(*cg_upcall_data_alloc_array_flat_types_ptr_mayfail)(frame_s *fp, uintptr_t local_type, int_default_t_upcall n_allocated, int_default_t_upcall n_used);
58 unsigned char *(*cg_upcall_data_alloc_array_pointers_mayfail)(int_default_t_upcall n_allocated, int_default_t_upcall n_used);
59 pointer_t (*cg_upcall_array_create_flat)(frame_s *fp, int_default_t_upcall length, uintptr_t content_slot);
60 pointer_t (*cg_upcall_array_create_pointers)(frame_s *fp, uintptr_t ip_offset, uintptr_t length_slot, pointer_t_upcall ptr);
61 pointer_t (*cg_upcall_array_create_sparse)(int_default_t_upcall length, pointer_t_upcall ptr);
62 pointer_t (*cg_upcall_array_sub)(pointer_t_upcall array, int_default_t_upcall start, int_default_t_upcall end, bool deref);
63 pointer_t (*cg_upcall_array_skip)(pointer_t_upcall array, int_default_t_upcall start, bool deref);
64 pointer_t (*cg_upcall_array_join)(pointer_t_upcall ptr1, pointer_t_upcall ptr2);
65 void *(*cg_upcall_ipret_io)(frame_s *fp, uintptr_t ip_offset, uintptr_t code_params);
66 int_default_t (*cg_upcall_ipret_system_property)(int_default_t_upcall idx);
67 #define f(n, s, u, sz, bits) \
68 bool (*cat(INT_binary_const_,s))(const s *v1, int_default_t_upcall v2, s *r, bool (*op)(const void *, const void *, void *));
69 for_all_int(f, for_all_empty)
70 #undef f
71 bool (*cat(FIXED_binary_add_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
72 bool (*cat(FIXED_binary_subtract_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
73 #define f(n, s, u, sz, bits) \
74 bool (*cat(FIXED_binary_multiply_,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_divide_,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_udivide_,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_modulo_,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_umodulo_,s))(const u *v1, const u *v2, u *r);
91 for_all_fixed(f)
92 #undef f
93 #define f(n, s, u, sz, bits) \
94 bool (*cat(FIXED_binary_power_,s))(const u *v1, const u *v2, u *r);
95 for_all_fixed(f)
96 #undef f
97 bool (*cat(FIXED_binary_shl_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
98 bool (*cat(FIXED_binary_shr_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
99 bool (*cat(FIXED_binary_ushr_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
100 bool (*cat(FIXED_binary_rol_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
101 bool (*cat(FIXED_binary_ror_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
102 bool (*cat(FIXED_binary_bts_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
103 bool (*cat(FIXED_binary_btr_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
104 bool (*cat(FIXED_binary_btc_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, uintbig_t *r);
105 bool (*cat(FIXED_binary_less_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
106 bool (*cat(FIXED_binary_less_equal_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
107 bool (*cat(FIXED_binary_greater_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
108 bool (*cat(FIXED_binary_greater_equal_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
109 bool (*cat(FIXED_binary_uless_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
110 bool (*cat(FIXED_binary_uless_equal_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
111 bool (*cat(FIXED_binary_ugreater_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
112 bool (*cat(FIXED_binary_ugreater_equal_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
113 bool (*cat(FIXED_binary_bt_,TYPE_INT_MAX))(const uintbig_t *v1, const uintbig_t *v2, ajla_flat_option_t *r);
114 void (*cat(FIXED_unary_neg_,TYPE_INT_MAX))(const uintbig_t *v1, uintbig_t *r);
115 #define f(n, s, u, sz, bits) \
116 void (*cat(FIXED_unary_bswap_,s))(const u *v1, u *r);
117 for_all_fixed(f)
118 #undef f
119 #define f(n, s, u, sz, bits) \
120 void (*cat(FIXED_unary_brev_,s))(const u *v1, u *r);
121 for_all_fixed(f)
122 #undef f
123 #define f(n, s, u, sz, bits) \
124 void (*cat(FIXED_unary_bsf_,s))(const u *v1, u *r);
125 for_all_fixed(f)
126 #undef f
127 #define f(n, s, u, sz, bits) \
128 void (*cat(FIXED_unary_bsr_,s))(const u *v1, u *r);
129 for_all_fixed(f)
130 #undef f
131 #define f(n, s, u, sz, bits) \
132 void (*cat(FIXED_unary_popcnt_,s))(const u *v1, u *r);
133 for_all_fixed(f)
134 #undef f
135 #define f(n, s, u, sz, bits) \
136 bool (*cat(FIXED_uto_int_,s))(const u *v1, int_default_t *r);
137 for_all_fixed(f)
138 #undef f
139 #define f(n, s, u, sz, bits) \
140 bool (*cat(FIXED_ufrom_int_,s))(const int_default_t *v1, u *r);
141 for_all_fixed(f)
142 #undef f
143 bool (*cat(INT_binary_add_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
144 bool (*cat(INT_binary_subtract_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
145 #define f(n, s, u, sz, bits) \
146 bool (*cat(INT_binary_multiply_,s))(const s *v1, const s *v2, s *r);
147 for_all_int(f, for_all_empty)
148 #undef f
149 #define f(n, s, u, sz, bits) \
150 bool (*cat(INT_binary_divide_,s))(const s *v1, const s *v2, s *r);
151 for_all_int(f, for_all_empty)
152 #undef f
153 #define f(n, s, u, sz, bits) \
154 bool (*cat(INT_binary_modulo_,s))(const s *v1, const s *v2, s *r);
155 for_all_int(f, for_all_empty)
156 #undef f
157 #define f(n, s, u, sz, bits) \
158 bool (*cat(INT_binary_power_,s))(const s *v1, const s *v2, s *r);
159 for_all_int(f, for_all_empty)
160 #undef f
161 bool (*cat(INT_binary_shl_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
162 bool (*cat(INT_binary_shr_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
163 bool (*cat(INT_binary_bts_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
164 bool (*cat(INT_binary_btr_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
165 bool (*cat(INT_binary_btc_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, intbig_t *r);
166 bool (*cat(INT_binary_bt_,TYPE_INT_MAX))(const intbig_t *v1, const intbig_t *v2, ajla_flat_option_t *r);
167 bool (*cat(INT_unary_neg_,TYPE_INT_MAX))(const intbig_t *v1, intbig_t *r);
168 #define f(n, s, u, sz, bits) \
169 bool (*cat(INT_unary_bsf_,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_bsr_,s))(const s *v1, s *r);
174 for_all_int(f, for_all_empty)
175 #undef f
176 #define f(n, s, u, sz, bits) \
177 bool (*cat(INT_unary_popcnt_,s))(const s *v1, s *r);
178 for_all_int(f, for_all_empty)
179 #undef f
180 #define f(n, t, nt, pack, unpack) \
181 bool (*cat(REAL_binary_add_,t))(const t *v1, const t *v2, t *r);
182 #define nf(n, t) \
183 void (*cat(REAL_binary_add_,t))(void);
184 for_all_real(f, nf)
185 #undef f
186 #undef nf
187 #define f(n, t, nt, pack, unpack) \
188 bool (*cat(REAL_binary_subtract_,t))(const t *v1, const t *v2, t *r);
189 #define nf(n, t) \
190 void (*cat(REAL_binary_subtract_,t))(void);
191 for_all_real(f, nf)
192 #undef f
193 #undef nf
194 #define f(n, t, nt, pack, unpack) \
195 bool (*cat(REAL_binary_multiply_,t))(const t *v1, const t *v2, t *r);
196 #define nf(n, t) \
197 void (*cat(REAL_binary_multiply_,t))(void);
198 for_all_real(f, nf)
199 #undef f
200 #undef nf
201 #define f(n, t, nt, pack, unpack) \
202 bool (*cat(REAL_binary_divide_,t))(const t *v1, const t *v2, t *r);
203 #define nf(n, t) \
204 void (*cat(REAL_binary_divide_,t))(void);
205 for_all_real(f, nf)
206 #undef f
207 #undef nf
208 #define f(n, t, nt, pack, unpack) \
209 bool (*cat(REAL_binary_modulo_,t))(const t *v1, const t *v2, t *r);
210 #define nf(n, t) \
211 void (*cat(REAL_binary_modulo_,t))(void);
212 for_all_real(f, nf)
213 #undef f
214 #undef nf
215 #define f(n, t, nt, pack, unpack) \
216 bool (*cat(REAL_binary_power_,t))(const t *v1, const t *v2, t *r);
217 #define nf(n, t) \
218 void (*cat(REAL_binary_power_,t))(void);
219 for_all_real(f, nf)
220 #undef f
221 #undef nf
222 #define f(n, t, nt, pack, unpack) \
223 bool (*cat(REAL_binary_ldexp_,t))(const t *v1, const t *v2, t *r);
224 #define nf(n, t) \
225 void (*cat(REAL_binary_ldexp_,t))(void);
226 for_all_real(f, nf)
227 #undef f
228 #undef nf
229 #define f(n, t, nt, pack, unpack) \
230 bool (*cat(REAL_binary_atan2_,t))(const t *v1, const t *v2, t *r);
231 #define nf(n, t) \
232 void (*cat(REAL_binary_atan2_,t))(void);
233 for_all_real(f, nf)
234 #undef f
235 #undef nf
236 #define f(n, t, nt, pack, unpack) \
237 bool (*cat(REAL_binary_equal_,t))(const t *v1, const t *v2, ajla_flat_option_t *r);
238 #define nf(n, t) \
239 void (*cat(REAL_binary_equal_,t))(void);
240 for_all_real(f, nf)
241 #undef f
242 #undef nf
243 #define f(n, t, nt, pack, unpack) \
244 bool (*cat(REAL_binary_not_equal_,t))(const t *v1, const t *v2, ajla_flat_option_t *r);
245 #define nf(n, t) \
246 void (*cat(REAL_binary_not_equal_,t))(void);
247 for_all_real(f, nf)
248 #undef f
249 #undef nf
250 #define f(n, t, nt, pack, unpack) \
251 bool (*cat(REAL_binary_less_,t))(const t *v1, const t *v2, ajla_flat_option_t *r);
252 #define nf(n, t) \
253 void (*cat(REAL_binary_less_,t))(void);
254 for_all_real(f, nf)
255 #undef f
256 #undef nf
257 #define f(n, t, nt, pack, unpack) \
258 bool (*cat(REAL_binary_less_equal_,t))(const t *v1, const t *v2, ajla_flat_option_t *r);
259 #define nf(n, t) \
260 void (*cat(REAL_binary_less_equal_,t))(void);
261 for_all_real(f, nf)
262 #undef f
263 #undef nf
264 #define f(n, t, nt, pack, unpack) \
265 bool (*cat(REAL_binary_greater_,t))(const t *v1, const t *v2, ajla_flat_option_t *r);
266 #define nf(n, t) \
267 void (*cat(REAL_binary_greater_,t))(void);
268 for_all_real(f, nf)
269 #undef f
270 #undef nf
271 #define f(n, t, nt, pack, unpack) \
272 bool (*cat(REAL_binary_greater_equal_,t))(const t *v1, const t *v2, ajla_flat_option_t *r);
273 #define nf(n, t) \
274 void (*cat(REAL_binary_greater_equal_,t))(void);
275 for_all_real(f, nf)
276 #undef f
277 #undef nf
278 #define f(n, t, nt, pack, unpack) \
279 void (*cat(REAL_unary_neg_,t))(const t *v1, t *r);
280 #define nf(n, t) \
281 void (*cat(REAL_unary_neg_,t))(void);
282 for_all_real(f, nf)
283 #undef f
284 #undef nf
285 #define f(n, t, nt, pack, unpack) \
286 void (*cat(REAL_unary_sqrt_,t))(const t *v1, t *r);
287 #define nf(n, t) \
288 void (*cat(REAL_unary_sqrt_,t))(void);
289 for_all_real(f, nf)
290 #undef f
291 #undef nf
292 #define f(n, t, nt, pack, unpack) \
293 void (*cat(REAL_unary_cbrt_,t))(const t *v1, t *r);
294 #define nf(n, t) \
295 void (*cat(REAL_unary_cbrt_,t))(void);
296 for_all_real(f, nf)
297 #undef f
298 #undef nf
299 #define f(n, t, nt, pack, unpack) \
300 void (*cat(REAL_unary_sin_,t))(const t *v1, t *r);
301 #define nf(n, t) \
302 void (*cat(REAL_unary_sin_,t))(void);
303 for_all_real(f, nf)
304 #undef f
305 #undef nf
306 #define f(n, t, nt, pack, unpack) \
307 void (*cat(REAL_unary_cos_,t))(const t *v1, t *r);
308 #define nf(n, t) \
309 void (*cat(REAL_unary_cos_,t))(void);
310 for_all_real(f, nf)
311 #undef f
312 #undef nf
313 #define f(n, t, nt, pack, unpack) \
314 void (*cat(REAL_unary_tan_,t))(const t *v1, t *r);
315 #define nf(n, t) \
316 void (*cat(REAL_unary_tan_,t))(void);
317 for_all_real(f, nf)
318 #undef f
319 #undef nf
320 #define f(n, t, nt, pack, unpack) \
321 void (*cat(REAL_unary_asin_,t))(const t *v1, t *r);
322 #define nf(n, t) \
323 void (*cat(REAL_unary_asin_,t))(void);
324 for_all_real(f, nf)
325 #undef f
326 #undef nf
327 #define f(n, t, nt, pack, unpack) \
328 void (*cat(REAL_unary_acos_,t))(const t *v1, t *r);
329 #define nf(n, t) \
330 void (*cat(REAL_unary_acos_,t))(void);
331 for_all_real(f, nf)
332 #undef f
333 #undef nf
334 #define f(n, t, nt, pack, unpack) \
335 void (*cat(REAL_unary_atan_,t))(const t *v1, t *r);
336 #define nf(n, t) \
337 void (*cat(REAL_unary_atan_,t))(void);
338 for_all_real(f, nf)
339 #undef f
340 #undef nf
341 #define f(n, t, nt, pack, unpack) \
342 void (*cat(REAL_unary_sinh_,t))(const t *v1, t *r);
343 #define nf(n, t) \
344 void (*cat(REAL_unary_sinh_,t))(void);
345 for_all_real(f, nf)
346 #undef f
347 #undef nf
348 #define f(n, t, nt, pack, unpack) \
349 void (*cat(REAL_unary_cosh_,t))(const t *v1, t *r);
350 #define nf(n, t) \
351 void (*cat(REAL_unary_cosh_,t))(void);
352 for_all_real(f, nf)
353 #undef f
354 #undef nf
355 #define f(n, t, nt, pack, unpack) \
356 void (*cat(REAL_unary_tanh_,t))(const t *v1, t *r);
357 #define nf(n, t) \
358 void (*cat(REAL_unary_tanh_,t))(void);
359 for_all_real(f, nf)
360 #undef f
361 #undef nf
362 #define f(n, t, nt, pack, unpack) \
363 void (*cat(REAL_unary_asinh_,t))(const t *v1, t *r);
364 #define nf(n, t) \
365 void (*cat(REAL_unary_asinh_,t))(void);
366 for_all_real(f, nf)
367 #undef f
368 #undef nf
369 #define f(n, t, nt, pack, unpack) \
370 void (*cat(REAL_unary_acosh_,t))(const t *v1, t *r);
371 #define nf(n, t) \
372 void (*cat(REAL_unary_acosh_,t))(void);
373 for_all_real(f, nf)
374 #undef f
375 #undef nf
376 #define f(n, t, nt, pack, unpack) \
377 void (*cat(REAL_unary_atanh_,t))(const t *v1, t *r);
378 #define nf(n, t) \
379 void (*cat(REAL_unary_atanh_,t))(void);
380 for_all_real(f, nf)
381 #undef f
382 #undef nf
383 #define f(n, t, nt, pack, unpack) \
384 void (*cat(REAL_unary_exp2_,t))(const t *v1, t *r);
385 #define nf(n, t) \
386 void (*cat(REAL_unary_exp2_,t))(void);
387 for_all_real(f, nf)
388 #undef f
389 #undef nf
390 #define f(n, t, nt, pack, unpack) \
391 void (*cat(REAL_unary_exp_,t))(const t *v1, t *r);
392 #define nf(n, t) \
393 void (*cat(REAL_unary_exp_,t))(void);
394 for_all_real(f, nf)
395 #undef f
396 #undef nf
397 #define f(n, t, nt, pack, unpack) \
398 void (*cat(REAL_unary_exp10_,t))(const t *v1, t *r);
399 #define nf(n, t) \
400 void (*cat(REAL_unary_exp10_,t))(void);
401 for_all_real(f, nf)
402 #undef f
403 #undef nf
404 #define f(n, t, nt, pack, unpack) \
405 void (*cat(REAL_unary_log2_,t))(const t *v1, t *r);
406 #define nf(n, t) \
407 void (*cat(REAL_unary_log2_,t))(void);
408 for_all_real(f, nf)
409 #undef f
410 #undef nf
411 #define f(n, t, nt, pack, unpack) \
412 void (*cat(REAL_unary_log_,t))(const t *v1, t *r);
413 #define nf(n, t) \
414 void (*cat(REAL_unary_log_,t))(void);
415 for_all_real(f, nf)
416 #undef f
417 #undef nf
418 #define f(n, t, nt, pack, unpack) \
419 void (*cat(REAL_unary_log10_,t))(const t *v1, t *r);
420 #define nf(n, t) \
421 void (*cat(REAL_unary_log10_,t))(void);
422 for_all_real(f, nf)
423 #undef f
424 #undef nf
425 #define f(n, t, nt, pack, unpack) \
426 void (*cat(REAL_unary_round_,t))(const t *v1, t *r);
427 #define nf(n, t) \
428 void (*cat(REAL_unary_round_,t))(void);
429 for_all_real(f, nf)
430 #undef f
431 #undef nf
432 #define f(n, t, nt, pack, unpack) \
433 void (*cat(REAL_unary_ceil_,t))(const t *v1, t *r);
434 #define nf(n, t) \
435 void (*cat(REAL_unary_ceil_,t))(void);
436 for_all_real(f, nf)
437 #undef f
438 #undef nf
439 #define f(n, t, nt, pack, unpack) \
440 void (*cat(REAL_unary_floor_,t))(const t *v1, t *r);
441 #define nf(n, t) \
442 void (*cat(REAL_unary_floor_,t))(void);
443 for_all_real(f, nf)
444 #undef f
445 #undef nf
446 #define f(n, t, nt, pack, unpack) \
447 void (*cat(REAL_unary_trunc_,t))(const t *v1, t *r);
448 #define nf(n, t) \
449 void (*cat(REAL_unary_trunc_,t))(void);
450 for_all_real(f, nf)
451 #undef f
452 #undef nf
453 #define f(n, t, nt, pack, unpack) \
454 void (*cat(REAL_unary_fract_,t))(const t *v1, t *r);
455 #define nf(n, t) \
456 void (*cat(REAL_unary_fract_,t))(void);
457 for_all_real(f, nf)
458 #undef f
459 #undef nf
460 #define f(n, t, nt, pack, unpack) \
461 void (*cat(REAL_unary_mantissa_,t))(const t *v1, t *r);
462 #define nf(n, t) \
463 void (*cat(REAL_unary_mantissa_,t))(void);
464 for_all_real(f, nf)
465 #undef f
466 #undef nf
467 #define f(n, t, nt, pack, unpack) \
468 void (*cat(REAL_unary_exponent_,t))(const t *v1, t *r);
469 #define nf(n, t) \
470 void (*cat(REAL_unary_exponent_,t))(void);
471 for_all_real(f, nf)
472 #undef f
473 #undef nf
474 #define f(n, t, nt, pack, unpack) \
475 void (*cat(REAL_unary_next_number_,t))(const t *v1, t *r);
476 #define nf(n, t) \
477 void (*cat(REAL_unary_next_number_,t))(void);
478 for_all_real(f, nf)
479 #undef f
480 #undef nf
481 #define f(n, t, nt, pack, unpack) \
482 void (*cat(REAL_unary_prev_number_,t))(const t *v1, t *r);
483 #define nf(n, t) \
484 void (*cat(REAL_unary_prev_number_,t))(void);
485 for_all_real(f, nf)
486 #undef f
487 #undef nf
488 #define f(n, t, nt, pack, unpack) \
489 bool (*cat(REAL_unary_to_int_,t))(const t *val, int_default_t *r);
490 #define nf(n, t) \
491 void (*cat(REAL_unary_to_int_,t))(void);
492 for_all_real(f, nf)
493 #undef f
494 #undef nf
495 #define f(n, t, nt, pack, unpack) \
496 void (*cat(REAL_unary_from_int_,t))(const int_default_t *val, t *r);
497 #define nf(n, t) \
498 void (*cat(REAL_unary_from_int_,t))(void);
499 for_all_real(f, nf)
500 #undef f
501 #undef nf
502 #define f(n, t, nt, pack, unpack) \
503 void (*cat(REAL_unary_is_exception_,t))(const t *v1, ajla_flat_option_t *r);
504 #define nf(n, t) \
505 void (*cat(REAL_unary_is_exception_,t))(void);
506 for_all_real(f, nf)
507 #undef f
508 #undef nf
509 #endif
510 #ifdef DEBUG_UPCALL
511 void (*cg_upcall_debug)(unsigned long x1, unsigned long x2, unsigned long x3, unsigned long x4);
512 #endif
515 #undef nf
517 extern struct cg_upcall_vector_s cg_upcall_vector;
519 #define tick_stamp (cg_upcall_vector.ts)
521 #endif