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