-
Notifications
You must be signed in to change notification settings - Fork 0
/
OpcodeClass.java
153 lines (147 loc) · 4.32 KB
/
OpcodeClass.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
package com.destranix.glslang;
public enum OpcodeClass {
OpClassMisc(Main.OP_CLASS_MISC),
OpClassDebug(Main.OP_CLASS_DEBUG),
OpClassAnnotate(Main.OP_CLASS_ANNOTATE),
OpClassExtension(Main.OP_CLASS_EXTENSION),
OpClassMode(Main.OP_CLASS_MODE),
OpClassType(Main.OP_CLASS_TYPE),
OpClassConstant(Main.OP_CLASS_CONSTANT),
OpClassMemory(Main.OP_CLASS_MEMORY),
OpClassFunction(Main.OP_CLASS_FUNCTION),
OpClassImage(Main.OP_CLASS_IMAGE),
OpClassConvert(Main.OP_CLASS_CONVERT),
OpClassComposite(Main.OP_CLASS_COMPOSITE),
OpClassArithmetic(Main.OP_CLASS_ARITHMETIC),
OpClassBit(Main.OP_CLASS_BIT),
OpClassRelationalLogical(Main.OP_CLASS_RELATIONAL_LOGICAL),
OpClassDerivative(Main.OP_CLASS_DERIVATIVE),
OpClassFlowControl(Main.OP_CLASS_FLOW_CONTROL),
OpClassAtomic(Main.OP_CLASS_ATOMIC),
OpClassPrimitive(Main.OP_CLASS_PRIMITIVE),
OpClassBarrier(Main.OP_CLASS_BARRIER),
OpClassGroup(Main.OP_CLASS_GROUP),
OpClassDeviceSideEnqueue(Main.OP_CLASS_DEVICE_SIDE_ENQUEUE),
OpClassPipe(Main.OP_CLASS_PIPE),
OpClassCount(Main.OP_CLASS_COUNT),
OpClassMissing(Main.OP_CLASS_MISSING);
private final int value;
private OpcodeClass(int value) {
this.value = value;
}
public int getConstant() {
return this.value;
}
public static OpcodeClass valueByStr(String str) {
switch (str) {
case "OpClassMisc":
return OpClassMisc;
case "OpClassDebug":
return OpClassDebug;
case "OpClassAnnotate":
return OpClassAnnotate;
case "OpClassExtension":
return OpClassExtension;
case "OpClassMode":
return OpClassMode;
case "OpClassType":
return OpClassType;
case "OpClassConstant":
return OpClassConstant;
case "OpClassMemory":
return OpClassMemory;
case "OpClassFunction":
return OpClassFunction;
case "OpClassImage":
return OpClassImage;
case "OpClassConvert":
return OpClassConvert;
case "OpClassComposite":
return OpClassComposite;
case "OpClassArithmetic":
return OpClassArithmetic;
case "OpClassBit":
return OpClassBit;
case "OpClassRelationalLogical":
return OpClassRelationalLogical;
case "OpClassDerivative":
return OpClassDerivative;
case "OpClassFlowControl":
return OpClassFlowControl;
case "OpClassAtomic":
return OpClassAtomic;
case "OpClassPrimitive":
return OpClassPrimitive;
case "OpClassBarrier":
return OpClassBarrier;
case "OpClassGroup":
return OpClassGroup;
case "OpClassDeviceSideEnqueue":
return OpClassDeviceSideEnqueue;
case "OpClassPipe":
return OpClassPipe;
case "OpClassCount":
return OpClassCount;
case "OpClassMissing":
return OpClassMissing;
default:
throw new IllegalArgumentException("Cannot translate string into enum value!");
}
}
public static OpcodeClass valueByConstant(int constant) {
switch (constant) {
case Main.OP_CLASS_MISC:
return OpClassMisc;
case Main.OP_CLASS_DEBUG:
return OpClassDebug;
case Main.OP_CLASS_ANNOTATE:
return OpClassAnnotate;
case Main.OP_CLASS_EXTENSION:
return OpClassExtension;
case Main.OP_CLASS_MODE:
return OpClassMode;
case Main.OP_CLASS_TYPE:
return OpClassType;
case Main.OP_CLASS_CONSTANT:
return OpClassConstant;
case Main.OP_CLASS_MEMORY:
return OpClassMemory;
case Main.OP_CLASS_FUNCTION:
return OpClassFunction;
case Main.OP_CLASS_IMAGE:
return OpClassImage;
case Main.OP_CLASS_CONVERT:
return OpClassConvert;
case Main.OP_CLASS_COMPOSITE:
return OpClassComposite;
case Main.OP_CLASS_ARITHMETIC:
return OpClassArithmetic;
case Main.OP_CLASS_BIT:
return OpClassBit;
case Main.OP_CLASS_RELATIONAL_LOGICAL:
return OpClassRelationalLogical;
case Main.OP_CLASS_DERIVATIVE:
return OpClassDerivative;
case Main.OP_CLASS_FLOW_CONTROL:
return OpClassFlowControl;
case Main.OP_CLASS_ATOMIC:
return OpClassAtomic;
case Main.OP_CLASS_PRIMITIVE:
return OpClassPrimitive;
case Main.OP_CLASS_BARRIER:
return OpClassBarrier;
case Main.OP_CLASS_GROUP:
return OpClassGroup;
case Main.OP_CLASS_DEVICE_SIDE_ENQUEUE:
return OpClassDeviceSideEnqueue;
case Main.OP_CLASS_PIPE:
return OpClassPipe;
case Main.OP_CLASS_COUNT:
return OpClassCount;
case Main.OP_CLASS_MISSING:
return OpClassMissing;
default:
throw new IllegalArgumentException("Cannot translate constant into enum value!");
}
}
}