ae2f_docs
Loading...
Searching...
No Matches
decl_glob_obj.h
Go to the documentation of this file.
1/** @file decl_glob_obj.h */
2
3#include "aclspv/spvty.h"
4#include <assert.h>
5#include <string.h>
6#include <stdlib.h>
7#include <stdio.h>
8
9#include <util/ctx.h>
10#include <util/emitx.h>
11#include <util/is_kernel.h>
12#include <util/fn.h>
13#include <util/entp.h>
14#include <util/bind.h>
15#include <util/constant.h>
16#include <util/scale.h>
17
18#include <attr/specid.h>
19#include <attr/location.h>
20#include <attr/storage_class.h>
21
22#include <ae2f/Keys.h>
23#include <ae2f/c90/StdBool.h>
24#include <ae2f/c90/StdInt.h>
25
26#include <spirv/unified1/spirv.h>
27#include <clang-c/Index.h>
28
29static enum CXChildVisitResult emit_decl_glob_obj_visit_attr_set(CXCursor h_cur, CXCursor h_parent, CXClientData ae2f_restrict h_data) {
30 CXString TEXT;
31 enum CXChildVisitResult RES = CXChildVisit_Break;
32 char* NEEDLE;
33 unsigned SET;
34
35 unless(h_cur.kind == CXCursor_AnnotateAttr) return CXChildVisit_Recurse;
36 TEXT = clang_getCursorSpelling(h_cur);
37
38 unless(NEEDLE = strstr(TEXT.data, "aclspv_set")) {
39 RES = CXChildVisit_Continue;
40 goto LBL_FINI;
41 }
42
43
44 sscanf(NEEDLE, "aclspv_set ( %u )", &SET);
45
46 *((aclspv_wrd_t* ae2f_restrict)h_data) = (aclspv_wrd_t)SET;
47
48LBL_FINI:
49 clang_disposeString(TEXT);
50 return RES;
51
52 (void)h_parent;
53}
54
55static enum CXChildVisitResult emit_decl_glob_obj_visit_fetch(CXCursor h_cur, CXCursor h_parent, CXClientData h_data) {
56#if !defined(NDEBUG) || !NDEBUG
57
58 CXString PARAM_NAME, FUNC_NAME;
59 aclspv_wrdcount_t POS_FOR_LOCAL;
60#endif
61 CXString PARAM_TY_NAME;
62 CXType PARAM_TY;
63
64#define PUSH_SIZE ((uintptr_t* ae2f_restrict)h_data)[0]
65#define BIND_IDX ((uintptr_t* ae2f_restrict)h_data)[1]
66#define CTX ((h_aclspv_ctx_t)((uintptr_t* ae2f_restrict)h_data)[2])
67#define ARG_IDX ((uintptr_t* ae2f_restrict)h_data)[3]
68#define INTERFACE_COUNT ((uintptr_t* ae2f_restrict)h_data)[4]
69#define IO_ARG_IDX ((uintptr_t* ae2f_restrict)h_data)[5]
70#define PSH_CONSTANT_ID ((uintptr_t* ae2f_restrict)h_data)[6]
71#define INTERFACES_MGR get_last_scale_from_vec(&CTX->m_scale_vars)
72#define INTERFACES ((util_bind* ae2f_restrict)get_buf_from_scale(&CTX->m_scale_vars, INTERFACES_MGR[0]))
73#define INFO (((INTERFACES + ARG_IDX)))
74
75 unless(h_cur.kind == CXCursor_ParmDecl) {
76 return CXChildVisit_Continue;
77 }
78
79 PARAM_TY = clang_getCursorType(h_cur);
80 ae2f_unexpected_but_if(ARG_IDX > UINT32_MAX) {
81 CTX->m_err = ACLSPV_COMPILE_TOO_BIG;
82 return CXChildVisit_Break;
83 }
84
85 /** FETCH BIND */
86 assert(INTERFACES_MGR->m_id == (size_t)CTX->m_tmp.m_w0);
87 { ae2f_assume(INTERFACES_MGR->m_id == (size_t)CTX->m_tmp.m_w0); }
88
90 grow_last_scale(&CTX->m_scale_vars, (size_t)(sizeof(util_bind) * (ARG_IDX + 1)))
91 ) {
92 CTX->m_err = ACLSPV_COMPILE_ALLOC_FAILED;
93 return CXChildVisit_Break;
94 }
95
97 INFO->m_unified.m_cursor = h_cur;
98 INFO->m_unified.m_entp_idx = CTX->m_tmp.m_w0;
99
100 /** not pointer|array type -> is push constant! */
101 unless(PARAM_TY.kind == CXType_Pointer || PARAM_TY.kind == CXType_ConstantArray) {
104 }
105
107 INFO->m_pshconst.m_pad = (aclspv_wrd_t)PUSH_SIZE;
108 INFO->m_pshconst.m_size = sz_to_count(clang_Type_getSizeOf(PARAM_TY));
109
110 PUSH_SIZE += INFO->m_pshconst.m_size;
111 return CXChildVisit_Continue;
112 }
113
114 INFO->m_unified.m_var_id = CTX->m_id++;
115 INFO->m_unified.m_var_elm_type_id = util_mk_constant_struct_id(1, CTX);
116 INFO->m_unified.m_var_type_id = util_mk_constant_ptr_storage_id(1, CTX);
117
118 INFO->m_bindable.m_set = 0;
119 INFO->m_bindable.m_binding = (aclspv_wrd_t)BIND_IDX;
120
121 /** FETCH BIND END */
122#if !defined(NDEBUG) || !NDEBUG
123 FUNC_NAME = clang_getCursorSpelling(h_parent);
124 PARAM_NAME = clang_getCursorSpelling(h_cur);
125
126 {
127 char* ae2f_restrict const
128 NAME_MERGE = malloc(strlen(FUNC_NAME.data) + strlen(PARAM_NAME.data) + 3);
129 const aclspv_wrdcount_t POS = CTX->m_count.m_name;
130 unless(NAME_MERGE) {
131LBL_ABRT_NALLOC:
132 CTX->m_err = ACLSPV_COMPILE_ALLOC_FAILED;
133 free(NAME_MERGE);
134 clang_disposeString(FUNC_NAME);
135 clang_disposeString(PARAM_NAME);
136 return CXChildVisit_Break;
137 }
138
139 strcpy(NAME_MERGE, FUNC_NAME.data);
140 strcat(NAME_MERGE, "::");
141 strcat(NAME_MERGE, PARAM_NAME.data);
142
143#define EMIT_POS CTX->m_count.m_name
144 unless((POS_FOR_LOCAL = EMIT_POS = emit_opcode(&CTX->m_section.m_name, EMIT_POS, SpvOpName, 0)))
145 goto LBL_ABRT_NALLOC;
146 unless((EMIT_POS = util_emit_wrd(&CTX->m_section.m_name, EMIT_POS, INFO->m_unified.m_var_id)))
147 goto LBL_ABRT_NALLOC;
148 unless((EMIT_POS = util_emit_str(&CTX->m_section.m_name, EMIT_POS, NAME_MERGE)))
149 goto LBL_ABRT_NALLOC;
150 set_oprnd_count_for_opcode(get_wrd_of_vec(&CTX->m_section.m_name)[POS], EMIT_POS - POS - 1);
151#undef EMIT_POS
152
153
154 free(NAME_MERGE);
155 }
156#endif
157
158#if !defined(NDEBUG) || !NDEBUG
159 clang_disposeString(FUNC_NAME);
160 clang_disposeString(PARAM_NAME);
161#endif
162
163 INFO->m_unified.m_storage_class = SpvStorageClassMax;
164
165 PARAM_TY_NAME = clang_getTypeSpelling(PARAM_TY);
166
167 if(PARAM_TY.kind == CXType_ConstantArray)
168 INFO->m_unified.m_storage_class = SpvStorageClassWorkgroup;
169 else if(strstr(PARAM_TY_NAME.data, "global")) {
170 INFO->m_unified.m_storage_class = SpvStorageClassStorageBuffer;
171 } else if (strstr(PARAM_TY_NAME.data, "constant")) {
172 INFO->m_unified.m_storage_class = SpvStorageClassUniform;
173 }
174
175 /** ATTRIBUTE HARD CODED? */
176 clang_visitChildren(
177 h_cur
178 , attr_storage_class
179 , &INFO->m_unified.m_storage_class
180 );
181
182 clang_disposeString(PARAM_TY_NAME);
183
184 switch(INFO->m_unified.m_storage_class) {
185 default:
186 case SpvStorageClassMax:
187 CTX->m_err = ACLSPV_COMPILE_STORAGE_CLASS_UNDEFINED;
188 return CXChildVisit_Break;
189
190 /** BINDABLES */
193 case SpvStorageClassUniform:
194 INFO->m_unified.m_var_type_id = util_mk_constant_ptr_uniform_id(1, CTX);
196 return CXChildVisit_Break;
197 }
199
200 case SpvStorageClassStorageBuffer:
201 clang_visitChildren(h_cur
202 , emit_decl_glob_obj_visit_attr_set
203 , &INFO->m_bindable.m_set
204 );
205
206 CTX->m_err = ACLSPV_COMPILE_ALLOC_FAILED;
207
208 ae2f_expected_but_else(CTX->m_count.m_decorate = util_emitx_4(
209 /** Decorations::Descriptorsets */
210 &CTX->m_section.m_decorate
211 , CTX->m_count.m_decorate
212 , SpvOpDecorate
213 , INFO->m_unified.m_var_id
214 , SpvDecorationDescriptorSet
215 , INFO->m_bindable.m_set
216 )) return CXChildVisit_Break;
217
218 ae2f_expected_but_else(CTX->m_count.m_decorate = util_emitx_4(
219 /** Decorations::Binding */
220 &CTX->m_section.m_decorate
221 , CTX->m_count.m_decorate
222 , SpvOpDecorate
223 , INFO->m_unified.m_var_id
224 , SpvDecorationBinding
225 , INFO->m_bindable.m_binding
226 )) return CXChildVisit_Break;
227
229 &CTX->m_section.m_vars
230 , CTX->m_count.m_vars
231 , INFO->m_unified.m_var_type_id
232 , INFO->m_unified.m_var_id
233 , INFO->m_unified.m_storage_class
234 )) return CXChildVisit_Break;
235
236 ++BIND_IDX;
237 break;
238
239 case SpvStorageClassWorkgroup:
240 PARAM_TY_NAME = clang_getTypeSpelling(PARAM_TY);
241 unless(strstr(PARAM_TY_NAME.data, "local")) {
242 clang_disposeString(PARAM_TY_NAME);
243 CTX->m_err = ACLSPV_COMPILE_MET_INVAL;
244 return CXChildVisit_Break;
245 } clang_disposeString(PARAM_TY_NAME);
246
247 unless(PARAM_TY.kind == CXType_ConstantArray) {
248 CTX->m_err = ACLSPV_COMPILE_WORKGROUP_MUST_BE_CONSTANT_ARRAY;
249 return CXChildVisit_Break;
250 }
251
252 {
253 aclspv_wrd_t SPECID_WORK = 0xFFFFFFFF;
254 const intmax_t NUM_ARR_ORIG = clang_getArraySize(PARAM_TY);
255 const intmax_t REAL_ARR_ORIG = clang_Type_getSizeOf(PARAM_TY);
256 const aclspv_wrd_t NUM_ARR = NUM_ARR_ORIG < 0 || NUM_ARR_ORIG > UINT32_MAX ? 0 : (aclspv_wrd_t)NUM_ARR_ORIG;
257 const aclspv_wrd_t REAL_ARR = REAL_ARR_ORIG < 0 || REAL_ARR_ORIG > UINT32_MAX ? 0 : (aclspv_wrd_t)REAL_ARR_ORIG;
258 const aclspv_wrd_t ELM_ARR = ae2f_expected(NUM_ARR && REAL_ARR) ? REAL_ARR / NUM_ARR : 0;
259 const aclspv_id_t VAL_ELM = util_mk_constant_val_id(ELM_ARR, CTX);
260 const aclspv_id_t VAL_2 = util_mk_constant_val_id(2, CTX);
261
262 const aclspv_id_t VAL_3 = util_mk_constant_val_id(3, CTX);
263
264 assert(REAL_ARR >= NUM_ARR && !(REAL_ARR % NUM_ARR));
265 { ae2f_assume(REAL_ARR >= NUM_ARR && !(REAL_ARR % NUM_ARR)); }
266
267 ae2f_expected_but_else(VAL_2) return CXChildVisit_Break;
268 ae2f_expected_but_else(VAL_ELM) return CXChildVisit_Break;
269
270 clang_visitChildren(
271 h_cur
272 , attr_specid
273 , &SPECID_WORK
274 );
275
276 ae2f_expected_but_else(NUM_ARR) {
277 CTX->m_err = ACLSPV_COMPILE_MET_INVAL;
278 return CXChildVisit_Break;
279 }
280
281 ae2f_expected_if(SPECID_WORK != 0xFFFFFFFF) {
282 util_constant* CONST_NODE = util_mk_constant_node(SPECID_WORK, CTX);
283
284 CTX->m_err = ACLSPV_COMPILE_ALLOC_FAILED;
285
286 ae2f_expected_but_else(CONST_NODE) {
287 return CXChildVisit_Break;
288 }
289
290 ae2f_expected_but_else(util_get_default_id(ID_DEFAULT_U32, CTX))
291 return CXChildVisit_Break;
292
293 unless(CONST_NODE->m_const_spec_id) {
295 &CTX->m_section.m_types
296 , CTX->m_count.m_types
297 , ID_DEFAULT_U32
298 , CTX->m_id
299 , NUM_ARR
300 );
301
302 const aclspv_wrdcount_t RETCOUNT_DC =
303 RETCOUNT_TY ? util_emitx_4(&CTX->m_section.m_decorate
304 , CTX->m_count.m_decorate
305 , SpvOpDecorate
306 , CTX->m_id
307 , SpvDecorationSpecId
308 , SPECID_WORK
309 ) : 0;
310
311
312 ae2f_expected_but_else(RETCOUNT_TY && RETCOUNT_DC) {
313 return CXChildVisit_Break;
314 }
315
316 CONST_NODE->m_const_spec_id = CTX->m_id++;
317 CONST_NODE->m_const_spec_type_id = ID_DEFAULT_U32;
318 CTX->m_count.m_types = RETCOUNT_TY;
319 CTX->m_count.m_decorate = RETCOUNT_DC;
320 } else ae2f_expected_but_else(util_default_is_int(CONST_NODE->m_const_spec_type_id)) {
321 CTX->m_err = ACLSPV_COMPILE_MET_INVAL;
322 return CXChildVisit_Break;
323 }
324
325 INFO->m_work.m_arr_count_id = CONST_NODE->m_const_spec_id;
326 } else {
327 INFO->m_work.m_arr_count_id = util_mk_constant_val_id(NUM_ARR, CTX);
328 }
329
330
332 &CTX->m_section.m_types
333 , CTX->m_count.m_types
334 , ID_DEFAULT_U32
335 , CTX->m_id
336 , SpvOpIMul
337 , CTX->m_id - 1
338 , VAL_ELM
339 ))
340 return CXChildVisit_Break;
341
343 &CTX->m_section.m_types
344 , CTX->m_count.m_types
345 , ID_DEFAULT_U32
346 , CTX->m_id + 1
347 , SpvOpIAdd
348 , CTX->m_id
349 , VAL_3
350 ))
351 return CXChildVisit_Break;
352
354 &CTX->m_section.m_types
355 , CTX->m_count.m_types
356 , ID_DEFAULT_U32
357 , CTX->m_id + 2
358 , SpvOpShiftRightLogical
359 , CTX->m_id + 1
360 , VAL_2
361 )) return CXChildVisit_Break;
362
364 &CTX->m_section.m_types
365 , CTX->m_count.m_types
366 , CTX->m_id + 3
367 , ID_DEFAULT_U32
368 , CTX->m_id + 2
369 )) return CXChildVisit_Break;
370
372 &CTX->m_section.m_types
373 , CTX->m_count.m_types
374 , CTX->m_id + 4
375 , SpvStorageClassWorkgroup /* c_storage_class */
376 , CTX->m_id + 3
377 )) return CXChildVisit_Break;
378
379 INFO->m_unified.m_var_id = CTX->m_id + 5;
380 INFO->m_unified.m_var_type_id = CTX->m_id + 4;
381 INFO->m_unified.m_var_elm_type_id = CTX->m_id + 3;
382 INFO->m_unified.m_storage_class = SpvStorageClassWorkgroup;
383
384 CTX->m_id += 6;
385 CTX->m_err = ACLSPV_COMPILE_OK;
386
387 ((aclspv_wrd_t* ae2f_restrict)CTX->m_section.m_name.m_p)[POS_FOR_LOCAL]
388 = INFO->m_unified.m_var_id;
389
391 &CTX->m_section.m_vars
392 , CTX->m_count.m_vars
393 , INFO->m_unified.m_var_type_id
394 , INFO->m_unified.m_var_id
395 , SpvStorageClassWorkgroup
396 )) return CXChildVisit_Break;
397 }
398
399 break;
400
401 /** LOCATED */
402
405 case SpvStorageClassInput:
406 INFO->m_unified.m_var_type_id = util_get_default_id(ID_DEFAULT_U32V4_PTR_INP, CTX);
407 }
408
411 case SpvStorageClassOutput:
412 INFO->m_unified.m_var_type_id = util_get_default_id(ID_DEFAULT_U32V4_PTR_OUT, CTX);
413 }
414
415 clang_visitChildren(h_cur, attr_location, &INFO->m_io.m_location);
416#define THIS_ENTP ((util_entp_t* ae2f_restrict)CTX->m_fnlist.m_entp.m_p)[CTX->m_tmp.m_w0]
417 /** TODO: this will now uintvec4. make this flexible some day */
418 assert(IO_ARG_IDX < THIS_ENTP.m_io.m_num);
419 INFO->m_unified.m_var_id = THIS_ENTP.m_io.m_anchour + (aclspv_wrd_t)IO_ARG_IDX;
420 INFO->m_unified.m_var_elm_type_id = util_mk_constant_vec32_id(4, CTX);
421
422 ae2f_expected_but_else(CTX->m_count.m_decorate = util_emitx_4(
423 &CTX->m_section.m_decorate
424 , CTX->m_count.m_decorate
425 , SpvOpDecorate
426 , INFO->m_unified.m_var_id
427 , SpvDecorationLocation
428 , INFO->m_io.m_location
429 )) return CXChildVisit_Break;
430
432 &CTX->m_section.m_vars
433 , CTX->m_count.m_vars
434 , INFO->m_unified.m_var_type_id
435 , INFO->m_unified.m_var_id
436 , INFO->m_unified.m_storage_class
437 )) return CXChildVisit_Break;
438
439 get_wrd_of_vec(&CTX->m_section.m_name)[POS_FOR_LOCAL] = INFO->m_unified.m_var_id;
440#undef THIS_ENTP
441
442 ++IO_ARG_IDX;
443 break;
444 }
445
446 CTX->m_err = ACLSPV_COMPILE_OK;
447 ++ARG_IDX;
449 return CXChildVisit_Continue;
450
451
452#undef PUSH_SIZE
453#undef BIND_IDX
454#undef CTX
455#undef ARG_IDX
456#undef INTERFACE_COUNT
457#undef VAR_INFOS
458#undef INTERFACES_MGR
459#undef INTERFACES
460#undef INFO
461
463 (void)h_parent;
464}
465
466static enum CXChildVisitResult emit_decl_glob_obj(CXCursor h_cur, CXCursor h_cur_parent, CXClientData h_ctx) {
467#define CTX ((x_aclspv_ctx* ae2f_restrict)h_ctx)
468 assert(CTX);
469
470 unless(h_cur.kind == CXCursor_CompoundStmt && h_cur_parent.kind == CXCursor_FunctionDecl)
471 return CXChildVisit_Recurse;
472
473 if(util_is_kernel(h_cur_parent)) {
474 uintptr_t BUFF[7] = {
475 0 /* push constant size */ ,
476 0 /* bind index */,
477 0 /* ctx */,
478 0 /* argument index */,
479 0 /* interface count */,
480 0 /* io argument count */,
481 0 /* push constant id when push constant size is not 0 */
482 };
483
484 const int NPARAMS = clang_Cursor_getNumArguments(h_cur_parent);
485
486 CTX->m_err = ACLSPV_COMPILE_ALLOC_FAILED;
487
488 if(NPARAMS < 0) {
489 CTX->m_err = ACLSPV_COMPILE_MET_INVAL;
490 return CXChildVisit_Break;
491 }
492
493 unless(NPARAMS) goto LBL_HOLLOW_ENTP;
494
495 BUFF[2] = (uintptr_t)CTX;
496
497 _aclspv_grow_vec(_aclspv_malloc, _aclspv_free, CTX->m_tmp.m_v0, (size_t)((unsigned)NPARAMS * sizeof(CXType)));
498 ae2f_expected_but_else(CTX->m_tmp.m_v0.m_p) {
499 CTX->m_err = ACLSPV_COMPILE_ALLOC_FAILED;
500 return CXChildVisit_Break;
501 }
502
503 clang_visitChildren(h_cur_parent, emit_decl_glob_obj_visit_fetch, BUFF);
504 ae2f_unexpected_but_if(CTX->m_err) return CXChildVisit_Break;
505 ae2f_unexpected_but_if(BUFF[0] > UINT32_MAX) {
506 CTX->m_err = ACLSPV_COMPILE_TOO_BIG;
507 return CXChildVisit_Break;
508 }
509
510
511 if(CTX->m_tmp.m_w2 < BUFF[0]) {
512 CTX->m_tmp.m_w2 = (aclspv_wrd_t)BUFF[0];
513 }
514
515 if(BUFF[0]) {
516 const aclspv_id_t PSH_PTR_ID = util_mk_constant_ptr_psh_id((aclspv_wrd_t)BUFF[0], CTX);
517 const aclspv_id_t PSH_VAR_ID = (aclspv_wrd_t)BUFF[6];
518
519#if !defined(NDEBUG) || !NDEBUG
520 const aclspv_wrdcount_t POS = CTX->m_count.m_name;
521 CXString NAME_STR = clang_getCursorSpelling(h_cur_parent);
522 char* ae2f_restrict NAME = NAME_STR.data ? malloc(strlen(NAME_STR.data) + (size_t)sizeof(":::push")) : 0;
523#endif
524
525 ae2f_expected_but_else(PSH_PTR_ID) {
526 CTX->m_err = ACLSPV_COMPILE_ALLOC_FAILED;
527 goto LBL_DBG_STR_DISPOSE_FAIL;
528 }
529
530 CTX->m_err = ACLSPV_COMPILE_ALLOC_FAILED;
531
532 ae2f_expected_but_else(CTX->m_count.m_vars = util_emitx_4(
533 &CTX->m_section.m_vars
534 , CTX->m_count.m_vars
535 , SpvOpVariable
536 , PSH_PTR_ID
537 , PSH_VAR_ID
538 , SpvStorageClassPushConstant
539 )) goto LBL_DBG_STR_DISPOSE_FAIL;
540
541
542#if !defined(NDEBUG) || !NDEBUG
543#define EMIT_POS CTX->m_count.m_name
544 ae2f_expected_but_else(NAME) goto LBL_DBG_STR_DISPOSE_FAIL;
545 strcpy(NAME, NAME_STR.data);
546 strcat(NAME, ":::push");
547
548
549 ae2f_expected_but_else((EMIT_POS = emit_opcode(&CTX->m_section.m_name, EMIT_POS, SpvOpName, 0)))
550 goto LBL_DBG_STR_DISPOSE_FAIL;
551 ae2f_expected_but_else((EMIT_POS = util_emit_wrd(&CTX->m_section.m_name, EMIT_POS, PSH_VAR_ID)))
552 goto LBL_DBG_STR_DISPOSE_FAIL;
553 ae2f_expected_but_else((EMIT_POS = util_emit_str(&CTX->m_section.m_name, EMIT_POS, NAME)))
554 goto LBL_DBG_STR_DISPOSE_FAIL;
555 set_oprnd_count_for_opcode(get_wrd_of_vec(&CTX->m_section.m_name)[POS], EMIT_POS - POS - 1);
556 clang_disposeString(NAME_STR);
557 free(NAME);
558
559 if(0) {
561LBL_DBG_STR_DISPOSE_FAIL:
562 clang_disposeString(NAME_STR);
563 free(NAME);
564 return CXChildVisit_Break;
565 }
566#undef EMIT_POS
567#endif
568
569
570 CTX->m_err = ACLSPV_COMPILE_OK;
571#if 1
572 ((util_entp_t* ae2f_restrict)CTX->m_fnlist.m_entp.m_p)[CTX->m_tmp.m_w0].m_push_ids.m_push_ptr
573 = PSH_PTR_ID;
574 ((util_entp_t* ae2f_restrict)CTX->m_fnlist.m_entp.m_p)[CTX->m_tmp.m_w0].m_push_ids.m_push_var
575 = PSH_VAR_ID;
576 ((util_entp_t* ae2f_restrict)CTX->m_fnlist.m_entp.m_p)[CTX->m_tmp.m_w0].m_push_ids.m_push_struct
577 = util_mk_constant_struct_id((aclspv_wrd_t)BUFF[0], CTX);
578
579
580 ((util_entp_t* ae2f_restrict)CTX->m_fnlist.m_entp.m_p)[CTX->m_tmp.m_w0].m_nprm = (aclspv_wrd_t)BUFF[3];
581#endif
582 }
583
584LBL_HOLLOW_ENTP:
585 mk_scale_from_vec(&CTX->m_scale_vars, 0);
586 ++CTX->m_tmp.m_w0;
587 } else {
588 }
589
590 return CXChildVisit_Continue;
591
592#undef CTX
594
595#if !defined(NDEBUG) || !NDEBUG
596#else
597LBL_DBG_STR_DISPOSE_FAIL:
598 return CXChildVisit_Break;
599#endif
600}
#define ae2f_IS_SHARED
Definition Call.auto.h:12
#define ae2f_OFF
Definition Call.auto.h:3
#define ae2f_WhenCXX(a)
Appears when the current language is C.
Definition Cxx.h:44
#define ae2f_WhenC(a)
Appears when the current language is C++.
Definition Cxx.h:38
#define unless(a)
Invokes when condition is false.
Definition Keys.h:34
#define ae2f_extern
Suggests the existence of external variable or function, in naming of C. [non-mangling].
Definition Keys.h:25
#define ae2f_NIL
Definition Nil.h:13
#define ACLSPV_ABI_DECL
Declaration as ABI.
Definition abi.h:23
#define STATE_VAL
#define FNINFO
#define cpysz
#define cpypad
#define ae2f_assume(a)
tells the compiler that value if a is false, below this keyword is not expected to be reached.
Definition cc.h:228
#define ae2f_unexpected_but_if(a)
Definition cc.h:192
#define ae2f_ccpure
Keyword as [[pure]] on C23.
Definition cc.h:52
#define ae2f_expected_but_else(a)
Definition cc.h:201
#define ae2f_expected_if(a)
Definition cc.h:195
#define ae2f_ccconst
Keyword as [[const]] on C23..
Definition cc.h:66
#define ae2f_noexcept
marker that this function does not throw something.
Definition cc.h:133
#define ae2f_restrict
Keyword as restrict on C99.
Definition cc.h:81
#define ae2f_expected_not(a)
expectes a as false.
Definition cc.h:185
#define ae2f_unreachable()
tells the compiler that below this keyword is not expected to be reached.
Definition cc.h:213
#define ae2f_fallthrough
explicitly tells compiler that fallthrough on switch is expected.
Definition cc.h:164
#define ae2f_inline
inline
Definition cc.h:149
#define ae2f_expected(a)
expectes a as true.
Definition cc.h:184
#define wrd_caps
Definition conf.h:11
#define wrd_caps_count
Definition conf.h:12
#define wrd_ext
Definition conf.h:14
#define wrd_ext_count
Definition conf.h:15
#define THIS_FUNCTION
#define CTX
#define THIS_ENTRY_POINT
#define ARG_IDX
#define INTERFACES_MGR
#define EMIT_POS
#define IO_ARG_IDX
#define INTERFACE_COUNT
#define PUSH_SIZE
#define PSH_CONSTANT_ID
#define THIS_ENTP
#define INFO
#define BIND_IDX
#define util_emitx_spec_constant(h_wrds, c_wrdcount, c_ty, c_retid, c_val)
Definition emitx.h:140
#define util_emitx_variable(h_wrds, c_wrdcount, c_type, c_retid, c_storage_class)
Definition emitx.h:131
#define util_emitx_spec_constant_op2(h_wrds, c_wrdcount, c_retid, c_ty, c_operator, c_opr_0, c_opr_1)
Definition emitx.h:146
#define util_emitx_type_array(h_wrds, c_wrdcount, c_retid, c_elm_type_id, c_arrcount_id)
Definition emitx.h:137
#define util_emitx_type_pointer(h_wrds, c_wrdcount, c_retid, c_storage_class, c_elm_type_id)
Definition emitx.h:134
#define ret_count
#define get_buf_from_scale(h_alloc, c_scale)
Definition scale.h:34
#define get_last_scale_from_vec(h_alloc)
Definition scale.h:31
#define aclspv_opcode_t
integer as operation code
Definition spvty.h:27
aclspv_wrd_t aclspv_wrdcount_t
the integer type represents the number of word.
Definition spvty.h:61
#define ACLSPV_MASK_OPCODE
mask for opcode
Definition spvty.h:37
#define aclspv_wrd_t
integer as word
Definition spvty.h:16
#define ACLSPV_MASK_NOPRNDS
mask for number of operands
Definition spvty.h:42
x_aclspv_vec m_scale_vars
Definition ctx.h:62
aclspv_wrdcount_t m_num_type_uniques
Definition ctx.h:44
x_aclspv_vec m_cursors
cache for cursors for parsing one function for its use see util/cursor.h
Definition ctx.h:77
x_aclspv_vec m_constant_cache
Definition ctx.h:65
aclspv_id_t m_id
id
Definition ctx.h:50
x_aclspv_vec m_ret
word count for m_ret
Definition ctx.h:56
aclspv_wrd_t m_is_logical
when on, ignores m_is_buffer_64.
Definition ctx.h:23
aclspv_wrdcount_t m_num_cursor
number of m_cursors. for its use see util/cursor.h
Definition ctx.h:41
x_aclspv_vec m_type_uniques
cache for complex types which needs to be stored somewhere for its use see util/type_unique....
Definition ctx.h:86
aclspv_wrd_t m_nprm
Definition entp.h:13
aclspv_wrdcount_t m_arr_count_id
Definition bind.h:34
aclspv_wrd_t m_size
Definition bind.h:47
util_bind_unified m_unified
Definition bind.h:20
aclspv_wrd_t m_set
Definition bind.h:26
aclspv_wrd_t m_pad
Definition bind.h:49
#define mk_noprnds(c_num_opprm)
Definition wrdemit.h:66
#define emit_opcode(h_wrds, c_wrdcount, c_opcode, c_num_opprm_opt)
try emit opcode with num_opprm
Definition wrdemit.h:75
#define sz_to_count(c_sz)
byte size to word count
Definition wrdemit.h:24
#define get_wrd_of_vec(vec)
get word buffer from vector
Definition wrdemit.h:38
aclspv_wrdcount_t spvsz_t
Definition wrdemit.h:18
#define count_to_sz(c_count)
word count to byte size
Definition wrdemit.h:32
#define set_oprnd_count_for_opcode(cr_wrd, c_num_opprm)
Definition wrdemit.h:78
#define opcode_to_wrd(c_opcode, c_num_opprm)
Definition wrdemit.h:69