-
Notifications
You must be signed in to change notification settings - Fork 0
/
Builder.java
1779 lines (1409 loc) · 49.7 KB
/
Builder.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package com.destranix.glslang;
import java.math.BigInteger;
import java.util.EnumSet;
public class Builder extends PointerBoundObject {
protected final long spvVersion;
protected final long userNumber;
protected final SpvBuildLogger logger;
private final int constructorIndex;
public Builder(long spvVersion, long userNumber, SpvBuildLogger logger) {
this.spvVersion = spvVersion;
this.userNumber = userNumber;
this.logger = logger;
this.constructorIndex = 0;
load();
}
protected Builder(byte[] ptr) {
this.ptr = ptr;
this.spvVersion = -1;
this.userNumber = -1;
this.logger = null;
this.constructorIndex = -1;
}
@Override
protected void load_intern() {
if (ptr == null) {
switch (constructorIndex) {
case -1:
throw new IllegalStateException(EXCEPTION_MSG_NOT_LOADABLE);
case 0:
ptr = Main.Builder(spvVersion, userNumber, logger.getPtr());
break;
default:
throw new AssertionError("Reached unreachable state!");
}
}
}
@Override
protected void free_intern() {
if (ptr != null) {
switch (constructorIndex) {
case -1:
throw new IllegalStateException(EXCEPTION_MSG_NOT_FREEABLE);
case 0:
Main.delete(ptr);
ptr = null;
break;
default:
throw new AssertionError("Reached unreachable state!");
}
}
}
public long getSpvVersion() {
return Main.Builder_getSpvVersion(ptr);
}
public void setSource(SourceLanguage lang, int version) {
Main.Builder_setSource(ptr, lang, version);
}
public long getStringId(String str) {
return Main.Builder_getStringId(ptr, str);
}
public void setSourceFile(String file) {
Main.Builder_setSourceFile(ptr, file);
}
public void setSourceText(String text) {
Main.Builder_setSourceText(ptr, text);
}
public void addSourceExtension(String ext) {
Main.Builder_addSourceExtension(ptr, ext);
}
public void addModuleProcessed(String p) {
Main.Builder_addModuleProcessed(ptr, p);
}
public void setEmitOpLines() {
Main.Builder_setEmitOpLines(ptr);
}
public void addExtension(String ext) {
Main.Builder_addExtension(ptr, ext);
}
public void removeExtension(String ext) {
Main.Builder_removeExtension(ptr, ext);
}
public void addIncorporatedExtension(String ext, SpvVersion incorporatedVersion) {
Main.Builder_addIncorporatedExtension(ptr, ext, incorporatedVersion);
}
public void promoteIncorporatedExtension(String baseExt, String promoExt, SpvVersion incorporatedVersion) {
Main.Builder_promoteIncorporatedExtension(ptr, baseExt, promoExt, incorporatedVersion);
}
public void addInclude(String name, String text) {
Main.Builder_addInclude(ptr, name, text);
}
public long importFunc(String s) {
return Main.Builder_import(ptr, s);
}
public void setMemoryModel(AddressingModel addr, MemoryModel mem) {
Main.Builder_setMemoryModel(ptr, addr, mem);
}
public void addCapability(Capability cap) {
Main.Builder_addCapability(ptr, cap);
}
public long getUniqueId() {
return Main.Builder_getUniqueId(ptr);
}
public long getUniqueIds(int numIds) {
return Main.Builder_getUniqueIds(ptr, numIds);
}
public void setLine(int line) {
Main.Builder_setLine(ptr, line);
}
public void setLine(int line, String filename) {
Main.Builder_setLine(ptr, line, filename);
}
public void addLine(long fileName, int line, int column) {
Main.Builder_addLine(ptr, fileName, line, column);
}
public long makeVoidType() {
return Main.Builder_makeVoidType(ptr);
}
public long makeBoolType() {
return Main.Builder_makeBoolType(ptr);
}
public long makePointer(StorageClass storageClass, long pointee) {
return Main.Builder_makePointer(ptr, storageClass, pointee);
}
public long makeForwardPointer(StorageClass storageClass) {
return Main.Builder_makeForwardPointer(ptr, storageClass);
}
public long makePointerFromForwardPointer(StorageClass storageClass, long forwardPointerType, long pointee) {
return Main.Builder_makePointerFromForwardPointer(ptr, storageClass, forwardPointerType, pointee);
}
public long makeIntegerType(int width, boolean hasSign) {
return Main.Builder_makeIntegerType(ptr, width, hasSign);
}
public long makeIntType(int width) {
return Main.Builder_makeIntType(ptr, width);
}
public long makeUintType(int width) {
return Main.Builder_makeUintType(ptr, width);
}
public long makeFloatType(int width) {
return Main.Builder_makeFloatType(ptr, width);
}
public long makeStructType(long[] members, String s) {
return Main.Builder_makeStructType(ptr, members, s);
}
public long makeStructResultType(long type0, long type1) {
return Main.Builder_makeStructResultType(ptr, type0, type1);
}
public long makeVectorType(long component, int size) {
return Main.Builder_makeVectorType(ptr, component, size);
}
public long BmakeMatrixType(long component, int cols, int rows) {
return Main.Builder_makeMatrixType(ptr, component, cols, rows);
}
public long makeArrayType(long element, long sizeId, int stride) {
return Main.Builder_makeArrayType(ptr, element, sizeId, stride);
}
public long makeRuntimeArray(long element) {
return Main.Builder_makeRuntimeArray(ptr, element);
}
public long makeFunctionType(long returnType, long[] paramTypes) {
return Main.Builder_makeFunctionType(ptr, returnType, paramTypes);
}
public long makeImageType(long sampledType, Dim dim, boolean depth, boolean arrayed, boolean ms, long sampled,
ImageFormat format) {
return Main.Builder_makeImageType(ptr, sampledType, dim, depth, arrayed, ms, sampled, format);
}
public long makeSamplerType() {
return Main.Builder_makeSamplerType(ptr);
}
public long makeSampledImageType(long imageType) {
return Main.Builder_makeSampledImageType(ptr, imageType);
}
public long makeCooperativeMatrixType(long component, long scope, long rows, long cols) {
return Main.Builder_makeCooperativeMatrixType(ptr, component, scope, rows, cols);
}
public long makeAccelerationStructureType() {
return Main.Builder_makeAccelerationStructureType(ptr);
}
public long makeRayQueryType() {
return Main.Builder_makeRayQueryType(ptr);
}
public long getTypeId(long resultId) {
return Main.Builder_getTypeId(ptr, resultId);
}
public long getDerefTypeId(long resultId) {
return Main.Builder_getDerefTypeId(ptr, resultId);
}
public int getOpCode(long id) {
return Main.Builder_getOpCode(ptr, id);
}
public int getTypeClass(long typeId) {
return Main.Builder_getTypeClass(ptr, typeId);
}
public int getMostBasicTypeClass(long typeId) {
return Main.Builder_getMostBasicTypeClass(ptr, typeId);
}
public int getNumComponents(long resultId) {
return Main.Builder_getNumComponents(ptr, resultId);
}
public int getNumTypeConstituents(long typeId) {
return Main.Builder_getNumTypeConstituents(ptr, typeId);
}
public int getNumTypeComponents(long typeId) {
return Main.Builder_getNumTypeComponents(ptr, typeId);
}
public long getScalarTypeId(long typeId) {
return Main.Builder_getScalarTypeId(ptr, typeId);
}
public long getContainedTypeId(long typeId) {
return Main.Builder_getContainedTypeId(ptr, typeId);
}
public long getContainedTypeId(long typeId, int i) {
return Main.Builder_getContainedTypeId(ptr, typeId, i);
}
public int getTypeStorageClass(long typeId) {
return Main.Builder_getTypeStorageClass(ptr, typeId);
}
public int getImageTypeFormat(long typeId) {
return Main.Builder_getImageTypeFormat(ptr, typeId);
}
public boolean isPointer(long resultId) {
return Main.Builder_isPointer(ptr, resultId);
}
public boolean isScalar(long resultId) {
return Main.Builder_isScalar(ptr, resultId);
}
public boolean isVector(long resultId) {
return Main.Builder_isVector(ptr, resultId);
}
public boolean isMatrix(long resultId) {
return Main.Builder_isMatrix(ptr, resultId);
}
public boolean isCooperativeMatrix(long resultId) {
return Main.Builder_isCooperativeMatrix(ptr, resultId);
}
public boolean isAggregate(long resultId) {
return Main.Builder_isAggregate(ptr, resultId);
}
public boolean isSampledImage(long resultId) {
return Main.Builder_isSampledImage(ptr, resultId);
}
public boolean isBoolType(long typeId) {
return Main.Builder_isBoolType(ptr, typeId);
}
public boolean isIntType(long typeId) {
return Main.Builder_isIntType(ptr, typeId);
}
public boolean isUintType(long typeId) {
return Main.Builder_isUintType(ptr, typeId);
}
public boolean isFloatType(long typeId) {
return Main.Builder_isFloatType(ptr, typeId);
}
public boolean isPointerType(long typeId) {
return Main.Builder_isPointerType(ptr, typeId);
}
public boolean isScalarType(long typeId) {
return Main.Builder_isScalarType(ptr, typeId);
}
public boolean isVectorType(long typeId) {
return Main.Builder_isVectorType(ptr, typeId);
}
public boolean isMatrixType(long typeId) {
return Main.Builder_isMatrixType(ptr, typeId);
}
public boolean isStructType(long typeId) {
return Main.Builder_isStructType(ptr, typeId);
}
public boolean isArrayType(long typeId) {
return Main.Builder_isArrayType(ptr, typeId);
}
public boolean isCooperativeMatrixType(long typeId) {
return Main.Builder_isCooperativeMatrixType(ptr, typeId);
}
public boolean isAggregateType(long typeId) {
return Main.Builder_isAggregateType(ptr, typeId);
}
public boolean isImageType(long typeId) {
return Main.Builder_isImageType(ptr, typeId);
}
public boolean isSamplerType(long typeId) {
return Main.Builder_isSamplerType(ptr, typeId);
}
public boolean isSampledImageType(long typeId) {
return Main.Builder_isSampledImageType(ptr, typeId);
}
public boolean containsType(long typeId, Op typeOp, long width) {
return Main.Builder_containsType(ptr, typeId, typeOp, width);
}
public boolean containsPhysicalStorageBufferOrArray(long typeId) {
return Main.Builder_containsPhysicalStorageBufferOrArray(ptr, typeId);
}
public boolean isConstantOpCode(Op typeOp) {
return Main.Builder_isConstantOpCode(ptr, typeOp);
}
public boolean isSpecConstantOpCode(Op opcode) {
return Main.Builder_isSpecConstantOpCode(ptr, opcode);
}
public boolean isConstant(long resultId) {
return Main.Builder_isConstant(ptr, resultId);
}
public boolean isConstantScalar(long resultId) {
return Main.Builder_isConstantScalar(ptr, resultId);
}
public boolean isSpecConstant(long resultId) {
return Main.Builder_isSpecConstant(ptr, resultId);
}
public long getConstantScalar(long resultId) {
return Main.Builder_getConstantScalar(ptr, resultId);
}
public int getStorageClass(long resultId) {
return Main.Builder_getStorageClass(ptr, resultId);
}
public boolean isVariableOpCode(Op opcode) {
return Main.Builder_isVariableOpCode(ptr, opcode);
}
public boolean isVariable(long resultId) {
return Main.Builder_isVariable(ptr, resultId);
}
public boolean isGlobalStorage(long resultId) {
return Main.Builder_isGlobalStorage(ptr, resultId);
}
public boolean isGlobalVariable(long resultId) {
return Main.Builder_isGlobalVariable(ptr, resultId);
}
public boolean isValidInitializer(long resultId) {
return Main.Builder_isValidInitializer(ptr, resultId);
}
public int getScalarTypeWidth(long typeId) {
return Main.Builder_getScalarTypeWidth(ptr, typeId);
}
public int getTypeNumColumns(long typeId) {
return Main.Builder_getTypeNumColumns(ptr, typeId);
}
public int getNumColumns(long resultId) {
return Main.Builder_getNumColumns(ptr, resultId);
}
public int getTypeNumRows(long typeId) {
return Main.Builder_getTypeNumRows(ptr, typeId);
}
public int getNumRows(long resultId) {
return Main.Builder_getNumRows(ptr, resultId);
}
public int getTypeDimensionality(long typeId) {
return Main.Builder_getTypeDimensionality(ptr, typeId);
}
public long getImageType(long resultId) {
return Main.Builder_getImageType(ptr, resultId);
}
public boolean isArrayedImageType(long typeId) {
return Main.Builder_isArrayedImageType(ptr, typeId);
}
public long makeBoolConstant(boolean b) {
return Main.Builder_makeBoolConstant(ptr, b);
}
public long makeBoolConstant(boolean b, boolean specConstant) {
return Main.Builder_makeBoolConstant(ptr, b, specConstant);
}
public long makeInt8Constant(int i) {
return Main.Builder_makeInt8Constant(ptr, i);
}
public long makeInt8Constant(int i, boolean specConstant) {
return Main.Builder_makeInt8Constant(ptr, i, specConstant);
}
public long makeUint8Constant(long u) {
return Main.Builder_makeUint8Constant(ptr, u);
}
public long makeUint8Constant(long u, boolean specConstant) {
return Main.Builder_makeUint8Constant(ptr, u, specConstant);
}
public long makeInt16Constant(int i) {
return Main.Builder_makeInt16Constant(ptr, i);
}
public long makeInt16Constant(int i, boolean specConstant) {
return Main.Builder_makeInt16Constant(ptr, i, specConstant);
}
public long makeUint16Constant(long u) {
return Main.Builder_makeUint16Constant(ptr, u);
}
public long makeUint16Constant(long u, boolean specConstant) {
return Main.Builder_makeUint16Constant(ptr, u, specConstant);
}
public long makeIntConstant(int i) {
return Main.Builder_makeIntConstant(ptr, i);
}
public long makeIntConstant(int i, boolean specConstant) {
return Main.Builder_makeIntConstant(ptr, i, specConstant);
}
public long makeUintConstant(long u) {
return Main.Builder_makeUintConstant(ptr, u);
}
public long makeUintConstant(long u, boolean specConstant) {
return Main.Builder_makeUintConstant(ptr, u, specConstant);
}
public long makeInt64Constant(BigInteger i) {
return Main.Builder_makeInt64Constant(ptr, i);
}
public long makeInt64Constant(BigInteger i, boolean specConstant) {
return Main.Builder_makeInt64Constant(ptr, i, specConstant);
}
public long makeUint64Constant(BigInteger u) {
return Main.Builder_makeUint64Constant(ptr, u);
}
public long makeUint64Constant(BigInteger u, boolean specConstant) {
return Main.Builder_makeUint64Constant(ptr, u, specConstant);
}
public long makeFloatConstant(float f) {
return Main.Builder_makeFloatConstant(ptr, f);
}
public long makeFloatConstant(float f, boolean specConstant) {
return Main.Builder_makeFloatConstant(ptr, f, specConstant);
}
public long makeDoubleConstant(double d) {
return Main.Builder_makeDoubleConstant(ptr, d);
}
public long makeDoubleConstant(double d, boolean specConstant) {
return Main.Builder_makeDoubleConstant(ptr, d, specConstant);
}
public long makeFloat16Constant(float f16) {
return Main.Builder_makeFloat16Constant(ptr, f16);
}
public long makeFloat16Constant(float f16, boolean specConstant) {
return Main.Builder_makeFloat16Constant(ptr, f16, specConstant);
}
public long makeFpConstant(long type, double d) {
return Main.Builder_makeFpConstant(ptr, type, d);
}
public long makeFpConstant(long type, double d, boolean specConstant) {
return Main.Builder_makeFpConstant(ptr, type, d, specConstant);
}
public long makeCompositeConstant(long type, long[] comps) {
return Main.Builder_makeCompositeConstant(ptr, type, comps);
}
public long makeCompositeConstant(long type, long[] comps, boolean specConst) {
return Main.Builder_makeCompositeConstant(ptr, type, comps, specConst);
}
public Instruction addEntryPoint(ExecutionModel mode, Function func, String name) {
return fromPtr(Main.Builder_addEntryPoint(ptr, mode, func.getPtr(), name), Instruction.class);
}
public void addExecutionMode(Function func, ExecutionMode mode) {
Main.Builder_addExecutionMode(ptr, func.getPtr(), mode);
}
public void addExecutionMode(Function func, ExecutionMode mode, int value1) {
Main.Builder_addExecutionMode(ptr, func.getPtr(), mode, value1);
}
public void addExecutionMode(Function func, ExecutionMode mode, int value1, int value2) {
Main.Builder_addExecutionMode(ptr, func.getPtr(), mode, value1, value2);
}
public void addExecutionMode(Function func, ExecutionMode mode, int value1, int value2, int value3) {
Main.Builder_addExecutionMode(ptr, func.getPtr(), mode, value1, value2, value3);
}
public void addExecutionMode(Function func, ExecutionMode mode, long[] literals) {
Main.Builder_addExecutionMode(ptr, func.getPtr(), mode, literals);
}
public void addExecutionModeId(Function func, ExecutionMode mode, long[] operandIds) {
Main.Builder_addExecutionModeId(ptr, func.getPtr(), mode, operandIds);
}
public void addName(long id, String name) {
Main.Builder_addName(ptr, id, name);
}
public void addMemberName(long id, int member, String name) {
Main.Builder_addMemberName(ptr, id, member, name);
}
public void addDecoration(long id, Decoration decoration) {
Main.Builder_addDecoration(ptr, id, decoration);
}
public void addDecoration(long id, Decoration decoration, int num) {
Main.Builder_addDecoration(ptr, id, decoration, num);
}
public void addDecoration(long id, Decoration decoration, String s) {
Main.Builder_addDecoration(ptr, id, decoration, s);
}
public void addDecoration(long id, Decoration decoration, long[] literals) {
Main.Builder_addDecoration(ptr, id, decoration, literals);
}
public void addDecoration(long id, Decoration decoration, String[] strings) {
Main.Builder_addDecoration(ptr, id, decoration, strings);
}
public void addDecorationId(long id, Decoration decoration, long idDecoration) {
Main.Builder_addDecorationId(ptr, id, decoration, idDecoration);
}
public void addDecorationId(long id, Decoration decoration, long[] operandIds) {
Main.Builder_addDecorationId(ptr, id, decoration, operandIds);
}
public void addMemberDecoration(long id, long member, Decoration decoration) {
Main.Builder_addMemberDecoration(ptr, id, member, decoration);
}
public void addMemberDecoration(long id, long member, Decoration decoration, int num) {
Main.Builder_addMemberDecoration(ptr, id, member, decoration, num);
}
public void addMemberDecoration(long id, long member, Decoration decoration, String s) {
Main.Builder_addMemberDecoration(ptr, id, member, decoration, s);
}
public void addMemberDecoration(long id, long member, Decoration decoration, long[] literals) {
Main.Builder_addMemberDecoration(ptr, id, member, decoration, literals);
}
public void addMemberDecoration(long id, long member, Decoration decoration, String[] strings) {
Main.Builder_addMemberDecoration(ptr, id, member, decoration, strings);
}
public void setBuildPoint(Block bp) {
Main.Builder_setBuildPoint(ptr, bp.getPtr());
}
public Block getBuildPoint() {
return fromPtr(Main.Builder_getBuildPoint(ptr), Block.class);
}
public Function makeEntryPoint(String s) {
return fromPtr(Main.Builder_makeEntryPoint(ptr, s), Function.class);
}
public Function Builder_makeFunctionEntry(Decoration precision, long returnType, String name, long[] paramTypes,
Decoration[][] precisions) {
int[][] precisionsArr = new int[precisions.length][];
for (int i = 0; i < precisionsArr.length; ++i) {
precisionsArr[i] = new int[precisions[i].length];
for (int j = 0; j < precisionsArr[i].length; ++j) {
precisionsArr[i][j] = precisions[i][j].getConstant();
}
}
return fromPtr(Main.Builder_makeFunctionEntry(ptr, precision, returnType, name, paramTypes, precisionsArr),
Function.class);
}
public Function Builder_makeFunctionEntry(Decoration precision, long returnType, String name, long[] paramTypes,
Decoration[][] precisions, Block[] entry) {
int[][] precisionsArr = new int[precisions.length][];
for (int i = 0; i < precisionsArr.length; ++i) {
precisionsArr[i] = new int[precisions[i].length];
for (int j = 0; j < precisionsArr[i].length; ++j) {
precisionsArr[i][j] = precisions[i][j].getConstant();
}
}
byte[][] entryArr = new byte[1][];
Function ret = fromPtr(
Main.Builder_makeFunctionEntry(ptr, precision, returnType, name, paramTypes, precisionsArr, entryArr),
Function.class);
entry[0] = fromPtr(entryArr[0], Block.class);
return ret;
}
public void makeReturn(boolean implicit) {
Main.Builder_makeReturn(ptr, implicit);
}
public void makeReturn(boolean implicit, long retVal) {
Main.Builder_makeReturn(ptr, implicit, retVal);
}
public void leaveFunction() {
Main.Builder_leaveFunction(ptr);
}
public void makeDiscard() {
Main.Builder_makeDiscard(ptr);
}
public long createVariable(Decoration precision, StorageClass storageClass, long type) {
return Main.Builder_createVariable(ptr, precision, storageClass, type, null, 0);
}
public long createVariable(Decoration precision, StorageClass storageClass, long type, String name) {
return Main.Builder_createVariable(ptr, precision, storageClass, type, name, 0);
}
public long createVariable(Decoration precision, StorageClass storageClass, long type, String name,
long initializer) {
return Main.Builder_createVariable(ptr, precision, storageClass, type, name, initializer);
}
public long createUndefined(long type) {
return Main.Builder_createUndefined(ptr, type);
}
public void createStore(long rValue, long lValue) {
Main.Builder_createStore(ptr, rValue, lValue);
}
public void createStore(long rValue, long lValue, MemoryAccessMask memoryAccess) {
Main.Builder_createStore(ptr, rValue, lValue, memoryAccess);
}
public void createStore(long rValue, long lValue, MemoryAccessMask memoryAccess, Scope scope) {
Main.Builder_createStore(ptr, rValue, lValue, memoryAccess, scope);
}
public void createStore(long rValue, long lValue, MemoryAccessMask memoryAccess, Scope scope, long alignment) {
Main.Builder_createStore(ptr, rValue, lValue, memoryAccess, scope, alignment);
}
public long createLoad(long lValue, Decoration precision) {
return Main.Builder_createLoad(ptr, lValue, precision);
}
public long createLoad(long lValue, Decoration precision, MemoryAccessMask memoryAccess) {
return Main.Builder_createLoad(ptr, lValue, precision, memoryAccess);
}
public long createLoad(long lValue, Decoration precision, MemoryAccessMask memoryAccess, Scope scope) {
return Main.Builder_createLoad(ptr, lValue, precision, memoryAccess, scope);
}
public long createLoad(long lValue, Decoration precision, MemoryAccessMask memoryAccess, Scope scope,
long alignment) {
return Main.Builder_createLoad(ptr, lValue, precision, memoryAccess, scope, alignment);
}
public long createAccessChain(StorageClass storageClass, long base, long[] offsets) {
return Main.Builder_createAccessChain(ptr, storageClass, base, offsets);
}
public long createArrayLength(long base, long member) {
return Main.Builder_createArrayLength(ptr, base, member);
}
public long createCooperativeMatrixLength(long type) {
return Main.Builder_createCooperativeMatrixLength(ptr, type);
}
public long createCompositeExtract(long composite, long typeId, long index) {
return Main.Builder_createCompositeExtract(ptr, composite, typeId, index);
}
public long createCompositeExtract(long composite, long typeId, long[] indexes) {
return Main.Builder_createCompositeExtract(ptr, composite, typeId, indexes);
}
public long createCompositeInsert(long object, long composite, long typeId, long index) {
return Main.Builder_createCompositeInsert(ptr, object, composite, typeId, index);
}
public long createCompositeInsert(long object, long composite, long typeId, long[] indexes) {
return Main.Builder_createCompositeInsert(ptr, object, composite, typeId, indexes);
}
public long createVectorExtractDynamic(long vector, long typeId, long componentIndex) {
return Main.Builder_createVectorExtractDynamic(ptr, vector, typeId, componentIndex);
}
public long createVectorInsertDynamic(long vector, long typeId, long component, long componentIndex) {
return Main.Builder_createVectorInsertDynamic(ptr, vector, typeId, component, componentIndex);
}
public void createNoResultOp(Op op) {
Main.Builder_createNoResultOp(ptr, op);
}
public void createNoResultOp(Op op, long operand) {
Main.Builder_createNoResultOp(ptr, op, operand);
}
public void createNoResultOp(Op op, long[] operands) {
Main.Builder_createNoResultOp(ptr, op, operands);
}
public void createNoResultOp(Op op, CVector<IdImmediate> operands) {
Main.Builder_createNoResultOp(ptr, op, operands.getPtr());
}
public void createControlBarrier(Scope execution, Scope memory, EnumSet<MemorySemanticsMask> mask) {
Main.Builder_createControlBarrier(ptr, execution, memory, mask);
}
public void createMemoryBarrier(long executionScope, long memorySemantics) {
Main.Builder_createMemoryBarrier(ptr, executionScope, memorySemantics);
}
public long createUnaryOp(Op op, long typeId, long operand) {
return Main.Builder_createUnaryOp(ptr, op, typeId, operand);
}
public long createBinOp(Op op, long typeId, long operand1, long operand2) {
return Main.Builder_createBinOp(ptr, op, typeId, operand1, operand2);
}
public long createTriOp(Op op, long typeId, long operand1, long operand2, long operand3) {
return Main.Builder_createTriOp(ptr, op, typeId, operand1, operand2, operand3);
}
public long createOp(Op op, long typeId, long[] operands) {
return Main.Builder_createOp(ptr, op, typeId, operands);
}
public long createOp(Op op, long typeId, CVector<IdImmediate> operands) {
return Main.Builder_createOp(ptr, op, typeId, operands.getPtr());
}
public long createFunctionCall(Function func, long[] ids) {
return Main.Builder_createFunctionCall(ptr, func.getPtr(), ids);
}
public long createSpecConstantOp(Op op, long typeId, long[] operands, long[] literals) {
return Main.Builder_createSpecConstantOp(ptr, op, typeId, operands, literals);
}
public long createRvalueSwizzle(Decoration precision, long typeId, long source, long[] channels) {
return Main.Builder_createRvalueSwizzle(ptr, precision, typeId, source, channels);
}
public long createLvalueSwizzle(long typeId, long target, long source, long[] channels) {
return Main.Builder_createLvalueSwizzle(ptr, typeId, target, source, channels);
}
public long setPrecision(long id, Decoration precision) {
return Main.Builder_setPrecision(ptr, id, precision);
}
public void promoteScalar(Decoration precision, long[] left, long[] right) {
Main.Builder_promoteScalar(ptr, precision, left, right);
}
public long smearScalar(Decoration precision, long scalarVal, long vectorType) {
return Main.Builder_smearScalar(ptr, precision, scalarVal, vectorType);
}
public long createBuiltinCall(long resultType, long builtins, int entryPoint, long[] args) {
return Main.Builder_createBuiltinCall(ptr, resultType, builtins, entryPoint, args);
}
public long createTextureCall(Decoration precision, long resultType, boolean sparse, boolean fetch, boolean proj,
boolean gather, boolean noImplicit, TextureParameters textureParameters, EnumSet<ImageOperandsMask> mask) {
return Main.Builder_createTextureCall(ptr, precision, resultType, sparse, fetch, proj, gather, noImplicit,
textureParameters.getPtr(), mask);
}
public long createTextureQueryCall(Op op, TextureParameters textureParameters, boolean isUnsignedResult) {
return Main.Builder_createTextureQueryCall(ptr, op, textureParameters.getPtr(), isUnsignedResult);
}
public long createSamplePositionCall(Decoration precision, long id0, long id1) {
return Main.Builder_createSamplePositionCall(ptr, precision, id0, id1);
}
public long createBitFieldExtractCall(Decoration precision, long id0, long id1, long id2, boolean isSigned) {
return Main.Builder_createBitFieldExtractCall(ptr, precision, id0, id1, id2, isSigned);
}
public long createBitFieldInsertCall(Decoration precision, long id0, long id1, long id2, long id3) {
return Main.Builder_createBitFieldInsertCall(ptr, precision, id0, id1, id2, id3);
}
public long createCompositeCompare(Decoration precision, long id0, long id1, boolean equal) {
return Main.Builder_createCompositeCompare(ptr, precision, id0, id1, equal);
}
public long createCompositeConstruct(long typeId, long[] constituents) {
return Main.Builder_createCompositeConstruct(ptr, typeId, constituents);
}
public long createConstructor(Decoration precision, long[] sources, long resultTypeId) {
return Main.Builder_createConstructor(ptr, precision, sources, resultTypeId);
}
public long createMatrixConstructor(Decoration precision, long[] sources, long constructee) {
return Main.Builder_createMatrixConstructor(ptr, precision, sources, constructee);
}
public void makeSwitch(long condition, long control, int numSegments, int[] caseValues, int[] valueToSegment,
int defaultSegment, CVector<Block> segmentBB) {
Main.Builder_makeSwitch(ptr, condition, control, numSegments, caseValues, valueToSegment, defaultSegment,
segmentBB.getPtr());
}
public void addSwitchBreak() {
Main.Builder_addSwitchBreak(ptr);
}
public void nextSwitchSegment(CVector<Block> segmentBB, int segment) {
Main.Builder_nextSwitchSegment(ptr, segmentBB.getPtr(), segment);
}
public void endSwitch(CVector<Block> segmentBB) {
Main.Builder_endSwitch(ptr, segmentBB.getPtr());
}// segmentBB is vector
public LoopBlocks makeNewLoop() {
return fromPtr(Main.Builder_makeNewLoop(ptr), LoopBlocks.class);
}
public Block makeNewBlock() {
return fromPtr(Main.Builder_makeNewBlock(ptr), Block.class);
}
public void createLoopContinue() {
Main.Builder_createLoopContinue(ptr);
}
public void createLoopExit() {
Main.Builder_createLoopExit(ptr);
}
public void closeLoop() {
Main.Builder_closeLoop(ptr);
}
public AccessChain getAccessChain() {
return fromPtr(Main.Builder_getAccessChain(ptr), AccessChain.class);
}
public void setAccessChain(AccessChain newChain) {
Main.Builder_setAccessChain(ptr, newChain.getPtr());
}
public void clearAccessChain() {
Main.Builder_clearAccessChain(ptr);
}
public void setAccessChainLValue(long lValue) {
Main.Builder_setAccessChainLValue(ptr, lValue);
}
public void setAccessChainRValue(long rValue) {
Main.Builder_setAccessChainRValue(ptr, rValue);
}
public void accessChainPush(long offset, AccessChain.CoherentFlags coherentFlags, long alignment) {
Main.Builder_accessChainPush(ptr, offset, coherentFlags.getPtr(), alignment);
}
public void accessChainPushSwizzle(long[] swizzle, long preSwizzleBaseType, AccessChain.CoherentFlags coherentFlags,
long alignment) {
Main.Builder_accessChainPushSwizzle(ptr, swizzle, preSwizzleBaseType, coherentFlags.getPtr(), alignment);
}
public void accessChainPushComponent(long component, long preSwizzleBaseType,
AccessChain.CoherentFlags coherentFlags, long alignment) {
Main.Builder_accessChainPushComponent(ptr, component, preSwizzleBaseType, coherentFlags.getPtr(), alignment);
}
public void accessChainStore(long rvalue) {
Main.Builder_accessChainStore(ptr, rvalue);
}
public void accessChainStore(long rvalue, MemoryAccessMask memoryAccess) {
Main.Builder_accessChainStore(ptr, rvalue, memoryAccess);
}
public void accessChainStore(long rvalue, MemoryAccessMask memoryAccess, Scope scope) {
Main.Builder_accessChainStore(ptr, rvalue, memoryAccess, scope);
}
public void accessChainStore(long rvalue, MemoryAccessMask memoryAccess, Scope scope, long alignment) {
Main.Builder_accessChainStore(ptr, rvalue, memoryAccess, scope, alignment);