LLZK 2.1.1
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.capi.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op C API Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10
11#include <limits>
12
13using namespace mlir;
14using namespace llvm;
15
16MlirOperation llzkFelt_AddFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
17 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.add"), location);
18 mlirOperationStateAddResults(&state, 1, &resultType);
19 mlirOperationStateAddOperands(&state, 1, &lhs);
20 mlirOperationStateAddOperands(&state, 1, &rhs);
21
22 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
23}
24
25bool llzkOperationIsA_Felt_AddFeltOp(MlirOperation inp) {
26 return llvm::isa<AddFeltOp>(unwrap(inp));
27}
28
29MlirValue llzkFelt_AddFeltOpGetLhs(MlirOperation op) {
30 auto range = llvm::cast<AddFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
31 assert(range.second == 1 && "expected fixed operand segment size");
32 assert(
33 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
34 "operand index exceeds intptr_t range"
35 );
36 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
37}
38
39void llzkFelt_AddFeltOpSetLhs(MlirOperation op, MlirValue value) {
40 auto range = llvm::cast<AddFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
41 assert(range.second == 1 && "expected fixed operand segment size");
42 assert(
43 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
44 "operand index exceeds intptr_t range"
45 );
46 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
47}
48
49MlirValue llzkFelt_AddFeltOpGetRhs(MlirOperation op) {
50 auto range = llvm::cast<AddFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
51 assert(range.second == 1 && "expected fixed operand segment size");
52 assert(
53 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
54 "operand index exceeds intptr_t range"
55 );
56 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
57}
58
59void llzkFelt_AddFeltOpSetRhs(MlirOperation op, MlirValue value) {
60 auto range = llvm::cast<AddFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
61 assert(range.second == 1 && "expected fixed operand segment size");
62 assert(
63 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
64 "operand index exceeds intptr_t range"
65 );
66 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
67}
68
69MlirValue llzkFelt_AddFeltOpGetResult(MlirOperation op) {
70 return mlirOperationGetResult(op, 0);
71}
72
73MlirOperation llzkFelt_AndFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
74 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.bit_and"), location);
75 mlirOperationStateAddResults(&state, 1, &resultType);
76 mlirOperationStateAddOperands(&state, 1, &lhs);
77 mlirOperationStateAddOperands(&state, 1, &rhs);
78
79 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
80}
81
82bool llzkOperationIsA_Felt_AndFeltOp(MlirOperation inp) {
83 return llvm::isa<AndFeltOp>(unwrap(inp));
84}
85
86MlirValue llzkFelt_AndFeltOpGetLhs(MlirOperation op) {
87 auto range = llvm::cast<AndFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
88 assert(range.second == 1 && "expected fixed operand segment size");
89 assert(
90 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
91 "operand index exceeds intptr_t range"
92 );
93 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
94}
95
96void llzkFelt_AndFeltOpSetLhs(MlirOperation op, MlirValue value) {
97 auto range = llvm::cast<AndFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
98 assert(range.second == 1 && "expected fixed operand segment size");
99 assert(
100 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
101 "operand index exceeds intptr_t range"
102 );
103 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
104}
105
106MlirValue llzkFelt_AndFeltOpGetRhs(MlirOperation op) {
107 auto range = llvm::cast<AndFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
108 assert(range.second == 1 && "expected fixed operand segment size");
109 assert(
110 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
111 "operand index exceeds intptr_t range"
112 );
113 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
114}
115
116void llzkFelt_AndFeltOpSetRhs(MlirOperation op, MlirValue value) {
117 auto range = llvm::cast<AndFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
118 assert(range.second == 1 && "expected fixed operand segment size");
119 assert(
120 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
121 "operand index exceeds intptr_t range"
122 );
123 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
124}
125
126MlirValue llzkFelt_AndFeltOpGetResult(MlirOperation op) {
127 return mlirOperationGetResult(op, 0);
128}
129
130MlirOperation llzkFelt_DivFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
131 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.div"), location);
132 mlirOperationStateAddResults(&state, 1, &resultType);
133 mlirOperationStateAddOperands(&state, 1, &lhs);
134 mlirOperationStateAddOperands(&state, 1, &rhs);
135
136 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
137}
138
139bool llzkOperationIsA_Felt_DivFeltOp(MlirOperation inp) {
140 return llvm::isa<DivFeltOp>(unwrap(inp));
141}
142
143MlirValue llzkFelt_DivFeltOpGetLhs(MlirOperation op) {
144 auto range = llvm::cast<DivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
145 assert(range.second == 1 && "expected fixed operand segment size");
146 assert(
147 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
148 "operand index exceeds intptr_t range"
149 );
150 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
151}
152
153void llzkFelt_DivFeltOpSetLhs(MlirOperation op, MlirValue value) {
154 auto range = llvm::cast<DivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
155 assert(range.second == 1 && "expected fixed operand segment size");
156 assert(
157 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
158 "operand index exceeds intptr_t range"
159 );
160 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
161}
162
163MlirValue llzkFelt_DivFeltOpGetRhs(MlirOperation op) {
164 auto range = llvm::cast<DivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
165 assert(range.second == 1 && "expected fixed operand segment size");
166 assert(
167 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
168 "operand index exceeds intptr_t range"
169 );
170 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
171}
172
173void llzkFelt_DivFeltOpSetRhs(MlirOperation op, MlirValue value) {
174 auto range = llvm::cast<DivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
175 assert(range.second == 1 && "expected fixed operand segment size");
176 assert(
177 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
178 "operand index exceeds intptr_t range"
179 );
180 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
181}
182
183MlirValue llzkFelt_DivFeltOpGetResult(MlirOperation op) {
184 return mlirOperationGetResult(op, 0);
185}
186
187MlirOperation llzkFelt_FeltConstantOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirAttribute value) {
188 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.const"), location);
189 mlirOperationStateAddResults(&state, 1, &resultType);
190 MlirContext ctx = mlirOpBuilderGetContext(builder);
191 llvm::SmallVector<MlirNamedAttribute, 1> attributes;
192 if (!mlirAttributeIsNull(value)) {
193 attributes.push_back(mlirNamedAttributeGet(mlirIdentifierGet(ctx, mlirStringRefCreateFromCString("value")), value));
194 }
195 mlirOperationStateAddAttributes(&state, attributes.size(), attributes.data());
196
197 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
198}
199
201 return llvm::isa<FeltConstantOp>(unwrap(inp));
202}
203
204MlirAttribute llzkFelt_FeltConstantOpGetValue(MlirOperation op) {
205 return mlirOperationGetAttributeByName(op, mlirStringRefCreateFromCString("value"));
206}
207
208void llzkFelt_FeltConstantOpSetValue(MlirOperation op, MlirAttribute attr) {
209 mlirOperationSetAttributeByName(op, mlirStringRefCreateFromCString("value"), attr);
210}
211
212MlirValue llzkFelt_FeltConstantOpGetResult(MlirOperation op) {
213 return mlirOperationGetResult(op, 0);
214}
215
216MlirOperation llzkFelt_InvFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue operand) {
217 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.inv"), location);
218 mlirOperationStateAddResults(&state, 1, &resultType);
219 mlirOperationStateAddOperands(&state, 1, &operand);
220
221 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
222}
223
224bool llzkOperationIsA_Felt_InvFeltOp(MlirOperation inp) {
225 return llvm::isa<InvFeltOp>(unwrap(inp));
226}
227
228MlirValue llzkFelt_InvFeltOpGetOperand(MlirOperation op) {
229 auto range = llvm::cast<InvFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
230 assert(range.second == 1 && "expected fixed operand segment size");
231 assert(
232 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
233 "operand index exceeds intptr_t range"
234 );
235 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
236}
237
238void llzkFelt_InvFeltOpSetOperand(MlirOperation op, MlirValue value) {
239 auto range = llvm::cast<InvFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
240 assert(range.second == 1 && "expected fixed operand segment size");
241 assert(
242 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
243 "operand index exceeds intptr_t range"
244 );
245 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
246}
247
248MlirValue llzkFelt_InvFeltOpGetResult(MlirOperation op) {
249 return mlirOperationGetResult(op, 0);
250}
251
252MlirOperation llzkFelt_MulFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
253 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.mul"), location);
254 mlirOperationStateAddResults(&state, 1, &resultType);
255 mlirOperationStateAddOperands(&state, 1, &lhs);
256 mlirOperationStateAddOperands(&state, 1, &rhs);
257
258 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
259}
260
261bool llzkOperationIsA_Felt_MulFeltOp(MlirOperation inp) {
262 return llvm::isa<MulFeltOp>(unwrap(inp));
263}
264
265MlirValue llzkFelt_MulFeltOpGetLhs(MlirOperation op) {
266 auto range = llvm::cast<MulFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
267 assert(range.second == 1 && "expected fixed operand segment size");
268 assert(
269 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
270 "operand index exceeds intptr_t range"
271 );
272 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
273}
274
275void llzkFelt_MulFeltOpSetLhs(MlirOperation op, MlirValue value) {
276 auto range = llvm::cast<MulFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
277 assert(range.second == 1 && "expected fixed operand segment size");
278 assert(
279 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
280 "operand index exceeds intptr_t range"
281 );
282 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
283}
284
285MlirValue llzkFelt_MulFeltOpGetRhs(MlirOperation op) {
286 auto range = llvm::cast<MulFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
287 assert(range.second == 1 && "expected fixed operand segment size");
288 assert(
289 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
290 "operand index exceeds intptr_t range"
291 );
292 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
293}
294
295void llzkFelt_MulFeltOpSetRhs(MlirOperation op, MlirValue value) {
296 auto range = llvm::cast<MulFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
297 assert(range.second == 1 && "expected fixed operand segment size");
298 assert(
299 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
300 "operand index exceeds intptr_t range"
301 );
302 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
303}
304
305MlirValue llzkFelt_MulFeltOpGetResult(MlirOperation op) {
306 return mlirOperationGetResult(op, 0);
307}
308
309MlirOperation llzkFelt_NegFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue operand) {
310 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.neg"), location);
311 mlirOperationStateAddResults(&state, 1, &resultType);
312 mlirOperationStateAddOperands(&state, 1, &operand);
313
314 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
315}
316
317bool llzkOperationIsA_Felt_NegFeltOp(MlirOperation inp) {
318 return llvm::isa<NegFeltOp>(unwrap(inp));
319}
320
321MlirValue llzkFelt_NegFeltOpGetOperand(MlirOperation op) {
322 auto range = llvm::cast<NegFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
323 assert(range.second == 1 && "expected fixed operand segment size");
324 assert(
325 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
326 "operand index exceeds intptr_t range"
327 );
328 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
329}
330
331void llzkFelt_NegFeltOpSetOperand(MlirOperation op, MlirValue value) {
332 auto range = llvm::cast<NegFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
333 assert(range.second == 1 && "expected fixed operand segment size");
334 assert(
335 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
336 "operand index exceeds intptr_t range"
337 );
338 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
339}
340
341MlirValue llzkFelt_NegFeltOpGetResult(MlirOperation op) {
342 return mlirOperationGetResult(op, 0);
343}
344
345MlirOperation llzkFelt_NotFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue operand) {
346 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.bit_not"), location);
347 mlirOperationStateAddResults(&state, 1, &resultType);
348 mlirOperationStateAddOperands(&state, 1, &operand);
349
350 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
351}
352
353bool llzkOperationIsA_Felt_NotFeltOp(MlirOperation inp) {
354 return llvm::isa<NotFeltOp>(unwrap(inp));
355}
356
357MlirValue llzkFelt_NotFeltOpGetOperand(MlirOperation op) {
358 auto range = llvm::cast<NotFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
359 assert(range.second == 1 && "expected fixed operand segment size");
360 assert(
361 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
362 "operand index exceeds intptr_t range"
363 );
364 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
365}
366
367void llzkFelt_NotFeltOpSetOperand(MlirOperation op, MlirValue value) {
368 auto range = llvm::cast<NotFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
369 assert(range.second == 1 && "expected fixed operand segment size");
370 assert(
371 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
372 "operand index exceeds intptr_t range"
373 );
374 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
375}
376
377MlirValue llzkFelt_NotFeltOpGetResult(MlirOperation op) {
378 return mlirOperationGetResult(op, 0);
379}
380
381MlirOperation llzkFelt_OrFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
382 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.bit_or"), location);
383 mlirOperationStateAddResults(&state, 1, &resultType);
384 mlirOperationStateAddOperands(&state, 1, &lhs);
385 mlirOperationStateAddOperands(&state, 1, &rhs);
386
387 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
388}
389
390bool llzkOperationIsA_Felt_OrFeltOp(MlirOperation inp) {
391 return llvm::isa<OrFeltOp>(unwrap(inp));
392}
393
394MlirValue llzkFelt_OrFeltOpGetLhs(MlirOperation op) {
395 auto range = llvm::cast<OrFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
396 assert(range.second == 1 && "expected fixed operand segment size");
397 assert(
398 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
399 "operand index exceeds intptr_t range"
400 );
401 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
402}
403
404void llzkFelt_OrFeltOpSetLhs(MlirOperation op, MlirValue value) {
405 auto range = llvm::cast<OrFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
406 assert(range.second == 1 && "expected fixed operand segment size");
407 assert(
408 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
409 "operand index exceeds intptr_t range"
410 );
411 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
412}
413
414MlirValue llzkFelt_OrFeltOpGetRhs(MlirOperation op) {
415 auto range = llvm::cast<OrFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
416 assert(range.second == 1 && "expected fixed operand segment size");
417 assert(
418 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
419 "operand index exceeds intptr_t range"
420 );
421 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
422}
423
424void llzkFelt_OrFeltOpSetRhs(MlirOperation op, MlirValue value) {
425 auto range = llvm::cast<OrFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
426 assert(range.second == 1 && "expected fixed operand segment size");
427 assert(
428 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
429 "operand index exceeds intptr_t range"
430 );
431 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
432}
433
434MlirValue llzkFelt_OrFeltOpGetResult(MlirOperation op) {
435 return mlirOperationGetResult(op, 0);
436}
437
438MlirOperation llzkFelt_PowFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
439 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.pow"), location);
440 mlirOperationStateAddResults(&state, 1, &resultType);
441 mlirOperationStateAddOperands(&state, 1, &lhs);
442 mlirOperationStateAddOperands(&state, 1, &rhs);
443
444 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
445}
446
447bool llzkOperationIsA_Felt_PowFeltOp(MlirOperation inp) {
448 return llvm::isa<PowFeltOp>(unwrap(inp));
449}
450
451MlirValue llzkFelt_PowFeltOpGetLhs(MlirOperation op) {
452 auto range = llvm::cast<PowFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
453 assert(range.second == 1 && "expected fixed operand segment size");
454 assert(
455 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
456 "operand index exceeds intptr_t range"
457 );
458 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
459}
460
461void llzkFelt_PowFeltOpSetLhs(MlirOperation op, MlirValue value) {
462 auto range = llvm::cast<PowFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
463 assert(range.second == 1 && "expected fixed operand segment size");
464 assert(
465 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
466 "operand index exceeds intptr_t range"
467 );
468 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
469}
470
471MlirValue llzkFelt_PowFeltOpGetRhs(MlirOperation op) {
472 auto range = llvm::cast<PowFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
473 assert(range.second == 1 && "expected fixed operand segment size");
474 assert(
475 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
476 "operand index exceeds intptr_t range"
477 );
478 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
479}
480
481void llzkFelt_PowFeltOpSetRhs(MlirOperation op, MlirValue value) {
482 auto range = llvm::cast<PowFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
483 assert(range.second == 1 && "expected fixed operand segment size");
484 assert(
485 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
486 "operand index exceeds intptr_t range"
487 );
488 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
489}
490
491MlirValue llzkFelt_PowFeltOpGetResult(MlirOperation op) {
492 return mlirOperationGetResult(op, 0);
493}
494
495MlirOperation llzkFelt_ShlFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
496 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.shl"), location);
497 mlirOperationStateAddResults(&state, 1, &resultType);
498 mlirOperationStateAddOperands(&state, 1, &lhs);
499 mlirOperationStateAddOperands(&state, 1, &rhs);
500
501 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
502}
503
504bool llzkOperationIsA_Felt_ShlFeltOp(MlirOperation inp) {
505 return llvm::isa<ShlFeltOp>(unwrap(inp));
506}
507
508MlirValue llzkFelt_ShlFeltOpGetLhs(MlirOperation op) {
509 auto range = llvm::cast<ShlFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
510 assert(range.second == 1 && "expected fixed operand segment size");
511 assert(
512 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
513 "operand index exceeds intptr_t range"
514 );
515 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
516}
517
518void llzkFelt_ShlFeltOpSetLhs(MlirOperation op, MlirValue value) {
519 auto range = llvm::cast<ShlFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
520 assert(range.second == 1 && "expected fixed operand segment size");
521 assert(
522 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
523 "operand index exceeds intptr_t range"
524 );
525 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
526}
527
528MlirValue llzkFelt_ShlFeltOpGetRhs(MlirOperation op) {
529 auto range = llvm::cast<ShlFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
530 assert(range.second == 1 && "expected fixed operand segment size");
531 assert(
532 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
533 "operand index exceeds intptr_t range"
534 );
535 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
536}
537
538void llzkFelt_ShlFeltOpSetRhs(MlirOperation op, MlirValue value) {
539 auto range = llvm::cast<ShlFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
540 assert(range.second == 1 && "expected fixed operand segment size");
541 assert(
542 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
543 "operand index exceeds intptr_t range"
544 );
545 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
546}
547
548MlirValue llzkFelt_ShlFeltOpGetResult(MlirOperation op) {
549 return mlirOperationGetResult(op, 0);
550}
551
552MlirOperation llzkFelt_ShrFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
553 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.shr"), location);
554 mlirOperationStateAddResults(&state, 1, &resultType);
555 mlirOperationStateAddOperands(&state, 1, &lhs);
556 mlirOperationStateAddOperands(&state, 1, &rhs);
557
558 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
559}
560
561bool llzkOperationIsA_Felt_ShrFeltOp(MlirOperation inp) {
562 return llvm::isa<ShrFeltOp>(unwrap(inp));
563}
564
565MlirValue llzkFelt_ShrFeltOpGetLhs(MlirOperation op) {
566 auto range = llvm::cast<ShrFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
567 assert(range.second == 1 && "expected fixed operand segment size");
568 assert(
569 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
570 "operand index exceeds intptr_t range"
571 );
572 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
573}
574
575void llzkFelt_ShrFeltOpSetLhs(MlirOperation op, MlirValue value) {
576 auto range = llvm::cast<ShrFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
577 assert(range.second == 1 && "expected fixed operand segment size");
578 assert(
579 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
580 "operand index exceeds intptr_t range"
581 );
582 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
583}
584
585MlirValue llzkFelt_ShrFeltOpGetRhs(MlirOperation op) {
586 auto range = llvm::cast<ShrFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
587 assert(range.second == 1 && "expected fixed operand segment size");
588 assert(
589 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
590 "operand index exceeds intptr_t range"
591 );
592 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
593}
594
595void llzkFelt_ShrFeltOpSetRhs(MlirOperation op, MlirValue value) {
596 auto range = llvm::cast<ShrFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
597 assert(range.second == 1 && "expected fixed operand segment size");
598 assert(
599 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
600 "operand index exceeds intptr_t range"
601 );
602 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
603}
604
605MlirValue llzkFelt_ShrFeltOpGetResult(MlirOperation op) {
606 return mlirOperationGetResult(op, 0);
607}
608
609MlirOperation llzkFelt_SignedIntDivFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
610 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.sintdiv"), location);
611 mlirOperationStateAddResults(&state, 1, &resultType);
612 mlirOperationStateAddOperands(&state, 1, &lhs);
613 mlirOperationStateAddOperands(&state, 1, &rhs);
614
615 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
616}
617
619 return llvm::isa<SignedIntDivFeltOp>(unwrap(inp));
620}
621
622MlirValue llzkFelt_SignedIntDivFeltOpGetLhs(MlirOperation op) {
623 auto range = llvm::cast<SignedIntDivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
624 assert(range.second == 1 && "expected fixed operand segment size");
625 assert(
626 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
627 "operand index exceeds intptr_t range"
628 );
629 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
630}
631
632void llzkFelt_SignedIntDivFeltOpSetLhs(MlirOperation op, MlirValue value) {
633 auto range = llvm::cast<SignedIntDivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
634 assert(range.second == 1 && "expected fixed operand segment size");
635 assert(
636 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
637 "operand index exceeds intptr_t range"
638 );
639 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
640}
641
642MlirValue llzkFelt_SignedIntDivFeltOpGetRhs(MlirOperation op) {
643 auto range = llvm::cast<SignedIntDivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
644 assert(range.second == 1 && "expected fixed operand segment size");
645 assert(
646 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
647 "operand index exceeds intptr_t range"
648 );
649 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
650}
651
652void llzkFelt_SignedIntDivFeltOpSetRhs(MlirOperation op, MlirValue value) {
653 auto range = llvm::cast<SignedIntDivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
654 assert(range.second == 1 && "expected fixed operand segment size");
655 assert(
656 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
657 "operand index exceeds intptr_t range"
658 );
659 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
660}
661
662MlirValue llzkFelt_SignedIntDivFeltOpGetResult(MlirOperation op) {
663 return mlirOperationGetResult(op, 0);
664}
665
666MlirOperation llzkFelt_SignedModFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
667 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.smod"), location);
668 mlirOperationStateAddResults(&state, 1, &resultType);
669 mlirOperationStateAddOperands(&state, 1, &lhs);
670 mlirOperationStateAddOperands(&state, 1, &rhs);
671
672 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
673}
674
676 return llvm::isa<SignedModFeltOp>(unwrap(inp));
677}
678
679MlirValue llzkFelt_SignedModFeltOpGetLhs(MlirOperation op) {
680 auto range = llvm::cast<SignedModFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
681 assert(range.second == 1 && "expected fixed operand segment size");
682 assert(
683 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
684 "operand index exceeds intptr_t range"
685 );
686 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
687}
688
689void llzkFelt_SignedModFeltOpSetLhs(MlirOperation op, MlirValue value) {
690 auto range = llvm::cast<SignedModFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
691 assert(range.second == 1 && "expected fixed operand segment size");
692 assert(
693 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
694 "operand index exceeds intptr_t range"
695 );
696 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
697}
698
699MlirValue llzkFelt_SignedModFeltOpGetRhs(MlirOperation op) {
700 auto range = llvm::cast<SignedModFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
701 assert(range.second == 1 && "expected fixed operand segment size");
702 assert(
703 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
704 "operand index exceeds intptr_t range"
705 );
706 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
707}
708
709void llzkFelt_SignedModFeltOpSetRhs(MlirOperation op, MlirValue value) {
710 auto range = llvm::cast<SignedModFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
711 assert(range.second == 1 && "expected fixed operand segment size");
712 assert(
713 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
714 "operand index exceeds intptr_t range"
715 );
716 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
717}
718
719MlirValue llzkFelt_SignedModFeltOpGetResult(MlirOperation op) {
720 return mlirOperationGetResult(op, 0);
721}
722
723MlirOperation llzkFelt_SubFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
724 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.sub"), location);
725 mlirOperationStateAddResults(&state, 1, &resultType);
726 mlirOperationStateAddOperands(&state, 1, &lhs);
727 mlirOperationStateAddOperands(&state, 1, &rhs);
728
729 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
730}
731
732bool llzkOperationIsA_Felt_SubFeltOp(MlirOperation inp) {
733 return llvm::isa<SubFeltOp>(unwrap(inp));
734}
735
736MlirValue llzkFelt_SubFeltOpGetLhs(MlirOperation op) {
737 auto range = llvm::cast<SubFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
738 assert(range.second == 1 && "expected fixed operand segment size");
739 assert(
740 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
741 "operand index exceeds intptr_t range"
742 );
743 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
744}
745
746void llzkFelt_SubFeltOpSetLhs(MlirOperation op, MlirValue value) {
747 auto range = llvm::cast<SubFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
748 assert(range.second == 1 && "expected fixed operand segment size");
749 assert(
750 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
751 "operand index exceeds intptr_t range"
752 );
753 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
754}
755
756MlirValue llzkFelt_SubFeltOpGetRhs(MlirOperation op) {
757 auto range = llvm::cast<SubFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
758 assert(range.second == 1 && "expected fixed operand segment size");
759 assert(
760 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
761 "operand index exceeds intptr_t range"
762 );
763 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
764}
765
766void llzkFelt_SubFeltOpSetRhs(MlirOperation op, MlirValue value) {
767 auto range = llvm::cast<SubFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
768 assert(range.second == 1 && "expected fixed operand segment size");
769 assert(
770 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
771 "operand index exceeds intptr_t range"
772 );
773 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
774}
775
776MlirValue llzkFelt_SubFeltOpGetResult(MlirOperation op) {
777 return mlirOperationGetResult(op, 0);
778}
779
780MlirOperation llzkFelt_UnsignedIntDivFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
781 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.uintdiv"), location);
782 mlirOperationStateAddResults(&state, 1, &resultType);
783 mlirOperationStateAddOperands(&state, 1, &lhs);
784 mlirOperationStateAddOperands(&state, 1, &rhs);
785
786 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
787}
788
790 return llvm::isa<UnsignedIntDivFeltOp>(unwrap(inp));
791}
792
793MlirValue llzkFelt_UnsignedIntDivFeltOpGetLhs(MlirOperation op) {
794 auto range = llvm::cast<UnsignedIntDivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
795 assert(range.second == 1 && "expected fixed operand segment size");
796 assert(
797 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
798 "operand index exceeds intptr_t range"
799 );
800 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
801}
802
803void llzkFelt_UnsignedIntDivFeltOpSetLhs(MlirOperation op, MlirValue value) {
804 auto range = llvm::cast<UnsignedIntDivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
805 assert(range.second == 1 && "expected fixed operand segment size");
806 assert(
807 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
808 "operand index exceeds intptr_t range"
809 );
810 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
811}
812
813MlirValue llzkFelt_UnsignedIntDivFeltOpGetRhs(MlirOperation op) {
814 auto range = llvm::cast<UnsignedIntDivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
815 assert(range.second == 1 && "expected fixed operand segment size");
816 assert(
817 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
818 "operand index exceeds intptr_t range"
819 );
820 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
821}
822
823void llzkFelt_UnsignedIntDivFeltOpSetRhs(MlirOperation op, MlirValue value) {
824 auto range = llvm::cast<UnsignedIntDivFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
825 assert(range.second == 1 && "expected fixed operand segment size");
826 assert(
827 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
828 "operand index exceeds intptr_t range"
829 );
830 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
831}
832
833MlirValue llzkFelt_UnsignedIntDivFeltOpGetResult(MlirOperation op) {
834 return mlirOperationGetResult(op, 0);
835}
836
837MlirOperation llzkFelt_UnsignedModFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
838 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.umod"), location);
839 mlirOperationStateAddResults(&state, 1, &resultType);
840 mlirOperationStateAddOperands(&state, 1, &lhs);
841 mlirOperationStateAddOperands(&state, 1, &rhs);
842
843 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
844}
845
847 return llvm::isa<UnsignedModFeltOp>(unwrap(inp));
848}
849
850MlirValue llzkFelt_UnsignedModFeltOpGetLhs(MlirOperation op) {
851 auto range = llvm::cast<UnsignedModFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
852 assert(range.second == 1 && "expected fixed operand segment size");
853 assert(
854 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
855 "operand index exceeds intptr_t range"
856 );
857 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
858}
859
860void llzkFelt_UnsignedModFeltOpSetLhs(MlirOperation op, MlirValue value) {
861 auto range = llvm::cast<UnsignedModFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
862 assert(range.second == 1 && "expected fixed operand segment size");
863 assert(
864 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
865 "operand index exceeds intptr_t range"
866 );
867 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
868}
869
870MlirValue llzkFelt_UnsignedModFeltOpGetRhs(MlirOperation op) {
871 auto range = llvm::cast<UnsignedModFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
872 assert(range.second == 1 && "expected fixed operand segment size");
873 assert(
874 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
875 "operand index exceeds intptr_t range"
876 );
877 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
878}
879
880void llzkFelt_UnsignedModFeltOpSetRhs(MlirOperation op, MlirValue value) {
881 auto range = llvm::cast<UnsignedModFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
882 assert(range.second == 1 && "expected fixed operand segment size");
883 assert(
884 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
885 "operand index exceeds intptr_t range"
886 );
887 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
888}
889
890MlirValue llzkFelt_UnsignedModFeltOpGetResult(MlirOperation op) {
891 return mlirOperationGetResult(op, 0);
892}
893
894MlirOperation llzkFelt_XorFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs) {
895 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString("felt.bit_xor"), location);
896 mlirOperationStateAddResults(&state, 1, &resultType);
897 mlirOperationStateAddOperands(&state, 1, &lhs);
898 mlirOperationStateAddOperands(&state, 1, &rhs);
899
900 return mlirOpBuilderInsert(builder, mlirOperationCreate(&state));
901}
902
903bool llzkOperationIsA_Felt_XorFeltOp(MlirOperation inp) {
904 return llvm::isa<XorFeltOp>(unwrap(inp));
905}
906
907MlirValue llzkFelt_XorFeltOpGetLhs(MlirOperation op) {
908 auto range = llvm::cast<XorFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
909 assert(range.second == 1 && "expected fixed operand segment size");
910 assert(
911 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
912 "operand index exceeds intptr_t range"
913 );
914 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
915}
916
917void llzkFelt_XorFeltOpSetLhs(MlirOperation op, MlirValue value) {
918 auto range = llvm::cast<XorFeltOp>(unwrap(op)).getODSOperandIndexAndLength(0);
919 assert(range.second == 1 && "expected fixed operand segment size");
920 assert(
921 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
922 "operand index exceeds intptr_t range"
923 );
924 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
925}
926
927MlirValue llzkFelt_XorFeltOpGetRhs(MlirOperation op) {
928 auto range = llvm::cast<XorFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
929 assert(range.second == 1 && "expected fixed operand segment size");
930 assert(
931 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
932 "operand index exceeds intptr_t range"
933 );
934 return mlirOperationGetOperand(op, static_cast<intptr_t>(range.first));
935}
936
937void llzkFelt_XorFeltOpSetRhs(MlirOperation op, MlirValue value) {
938 auto range = llvm::cast<XorFeltOp>(unwrap(op)).getODSOperandIndexAndLength(1);
939 assert(range.second == 1 && "expected fixed operand segment size");
940 assert(
941 static_cast<uintptr_t>(range.first) <= static_cast<uintptr_t>(std::numeric_limits<intptr_t>::max()) &&
942 "operand index exceeds intptr_t range"
943 );
944 mlirOperationSetOperand(op, static_cast<intptr_t>(range.first), value);
945}
946
947MlirValue llzkFelt_XorFeltOpGetResult(MlirOperation op) {
948 return mlirOperationGetResult(op, 0);
949}
MlirContext mlirOpBuilderGetContext(MlirOpBuilder builder)
Returns the MLIR context associated with builder.
Definition Builder.cpp:95
MlirOperation mlirOpBuilderInsert(MlirOpBuilder builder, MlirOperation op)
Inserts op at the current insertion point of builder and returns it.
Definition Builder.cpp:167
MlirValue llzkFelt_AddFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::AddFeltOp Operation.
MlirValue llzkFelt_AndFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::AndFeltOp Operation.
MlirValue llzkFelt_XorFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::XorFeltOp Operation.
MlirOperation llzkFelt_SignedIntDivFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::SignedIntDivFeltOp Operation.
MlirValue llzkFelt_ShrFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::ShrFeltOp Operation.
void llzkFelt_UnsignedModFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::UnsignedModFeltOp Operation.
MlirValue llzkFelt_SubFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::SubFeltOp Operation.
bool llzkOperationIsA_Felt_SubFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::SubFeltOp.
bool llzkOperationIsA_Felt_ShlFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::ShlFeltOp.
void llzkFelt_SubFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::SubFeltOp Operation.
MlirOperation llzkFelt_PowFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::PowFeltOp Operation.
void llzkFelt_AddFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::AddFeltOp Operation.
MlirValue llzkFelt_PowFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::PowFeltOp Operation.
MlirOperation llzkFelt_AddFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::AddFeltOp Operation.
void llzkFelt_ShrFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::ShrFeltOp Operation.
MlirOperation llzkFelt_NegFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue operand)
Build a llzk::felt::NegFeltOp Operation.
void llzkFelt_UnsignedIntDivFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::UnsignedIntDivFeltOp Operation.
MlirValue llzkFelt_MulFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::MulFeltOp Operation.
MlirOperation llzkFelt_NotFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue operand)
Build a llzk::felt::NotFeltOp Operation.
MlirValue llzkFelt_FeltConstantOpGetResult(MlirOperation op)
Get Result result from llzk::felt::FeltConstantOp Operation.
bool llzkOperationIsA_Felt_MulFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::MulFeltOp.
bool llzkOperationIsA_Felt_SignedModFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::SignedModFeltOp.
MlirValue llzkFelt_ShrFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::ShrFeltOp Operation.
bool llzkOperationIsA_Felt_FeltConstantOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::FeltConstantOp.
MlirValue llzkFelt_PowFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::PowFeltOp Operation.
MlirValue llzkFelt_InvFeltOpGetOperand(MlirOperation op)
Get Operand operand from llzk::felt::InvFeltOp Operation.
MlirValue llzkFelt_DivFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::DivFeltOp Operation.
MlirValue llzkFelt_PowFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::PowFeltOp Operation.
MlirOperation llzkFelt_XorFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::XorFeltOp Operation.
MlirValue llzkFelt_InvFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::InvFeltOp Operation.
void llzkFelt_SignedIntDivFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::SignedIntDivFeltOp Operation.
void llzkFelt_DivFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::DivFeltOp Operation.
MlirValue llzkFelt_UnsignedModFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::UnsignedModFeltOp Operation.
MlirValue llzkFelt_SubFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::SubFeltOp Operation.
MlirValue llzkFelt_SignedModFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::SignedModFeltOp Operation.
void llzkFelt_OrFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::OrFeltOp Operation.
MlirValue llzkFelt_NegFeltOpGetOperand(MlirOperation op)
Get Operand operand from llzk::felt::NegFeltOp Operation.
MlirValue llzkFelt_OrFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::OrFeltOp Operation.
MlirValue llzkFelt_ShrFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::ShrFeltOp Operation.
MlirOperation llzkFelt_AndFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::AndFeltOp Operation.
void llzkFelt_InvFeltOpSetOperand(MlirOperation op, MlirValue value)
Set Operand operand of llzk::felt::InvFeltOp Operation.
void llzkFelt_SubFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::SubFeltOp Operation.
MlirValue llzkFelt_UnsignedIntDivFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::UnsignedIntDivFeltOp Operation.
MlirValue llzkFelt_DivFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::DivFeltOp Operation.
bool llzkOperationIsA_Felt_ShrFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::ShrFeltOp.
MlirValue llzkFelt_UnsignedIntDivFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::UnsignedIntDivFeltOp Operation.
MlirValue llzkFelt_ShlFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::ShlFeltOp Operation.
MlirValue llzkFelt_ShlFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::ShlFeltOp Operation.
void llzkFelt_MulFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::MulFeltOp Operation.
bool llzkOperationIsA_Felt_DivFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::DivFeltOp.
MlirValue llzkFelt_AddFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::AddFeltOp Operation.
MlirValue llzkFelt_NotFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::NotFeltOp Operation.
bool llzkOperationIsA_Felt_NegFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::NegFeltOp.
MlirOperation llzkFelt_SubFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::SubFeltOp Operation.
MlirValue llzkFelt_XorFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::XorFeltOp Operation.
MlirOperation llzkFelt_OrFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::OrFeltOp Operation.
MlirValue llzkFelt_AndFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::AndFeltOp Operation.
MlirValue llzkFelt_NegFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::NegFeltOp Operation.
MlirOperation llzkFelt_ShlFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::ShlFeltOp Operation.
MlirValue llzkFelt_SubFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::SubFeltOp Operation.
void llzkFelt_OrFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::OrFeltOp Operation.
MlirOperation llzkFelt_InvFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue operand)
Build a llzk::felt::InvFeltOp Operation.
void llzkFelt_SignedModFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::SignedModFeltOp Operation.
void llzkFelt_UnsignedModFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::UnsignedModFeltOp Operation.
void llzkFelt_SignedModFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::SignedModFeltOp Operation.
MlirValue llzkFelt_AddFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::AddFeltOp Operation.
MlirOperation llzkFelt_UnsignedIntDivFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::UnsignedIntDivFeltOp Operation.
bool llzkOperationIsA_Felt_AndFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::AndFeltOp.
MlirOperation llzkFelt_SignedModFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::SignedModFeltOp Operation.
MlirOperation llzkFelt_ShrFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::ShrFeltOp Operation.
MlirOperation llzkFelt_DivFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::DivFeltOp Operation.
void llzkFelt_FeltConstantOpSetValue(MlirOperation op, MlirAttribute attr)
Set Value attribute of llzk::felt::FeltConstantOp Operation.
bool llzkOperationIsA_Felt_XorFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::XorFeltOp.
MlirValue llzkFelt_SignedIntDivFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::SignedIntDivFeltOp Operation.
MlirValue llzkFelt_XorFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::XorFeltOp Operation.
void llzkFelt_PowFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::PowFeltOp Operation.
void llzkFelt_XorFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::XorFeltOp Operation.
void llzkFelt_NotFeltOpSetOperand(MlirOperation op, MlirValue value)
Set Operand operand of llzk::felt::NotFeltOp Operation.
MlirValue llzkFelt_SignedIntDivFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::SignedIntDivFeltOp Operation.
bool llzkOperationIsA_Felt_PowFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::PowFeltOp.
void llzkFelt_XorFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::XorFeltOp Operation.
MlirValue llzkFelt_MulFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::MulFeltOp Operation.
void llzkFelt_ShlFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::ShlFeltOp Operation.
void llzkFelt_SignedIntDivFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::SignedIntDivFeltOp Operation.
MlirValue llzkFelt_SignedModFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::SignedModFeltOp Operation.
void llzkFelt_UnsignedIntDivFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::UnsignedIntDivFeltOp Operation.
bool llzkOperationIsA_Felt_UnsignedModFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::UnsignedModFeltOp.
void llzkFelt_ShlFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::ShlFeltOp Operation.
MlirValue llzkFelt_UnsignedModFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::UnsignedModFeltOp Operation.
MlirValue llzkFelt_OrFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::OrFeltOp Operation.
bool llzkOperationIsA_Felt_InvFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::InvFeltOp.
bool llzkOperationIsA_Felt_OrFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::OrFeltOp.
MlirValue llzkFelt_UnsignedModFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::UnsignedModFeltOp Operation.
bool llzkOperationIsA_Felt_NotFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::NotFeltOp.
MlirAttribute llzkFelt_FeltConstantOpGetValue(MlirOperation op)
Get Value attribute from llzk::felt::FeltConstantOp Operation.
bool llzkOperationIsA_Felt_SignedIntDivFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::SignedIntDivFeltOp.
MlirValue llzkFelt_DivFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::DivFeltOp Operation.
void llzkFelt_AndFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::AndFeltOp Operation.
MlirValue llzkFelt_ShlFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::ShlFeltOp Operation.
void llzkFelt_AddFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::AddFeltOp Operation.
bool llzkOperationIsA_Felt_UnsignedIntDivFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::UnsignedIntDivFeltOp.
MlirValue llzkFelt_SignedModFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::SignedModFeltOp Operation.
void llzkFelt_DivFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::DivFeltOp Operation.
MlirValue llzkFelt_AndFeltOpGetResult(MlirOperation op)
Get Result result from llzk::felt::AndFeltOp Operation.
void llzkFelt_MulFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::MulFeltOp Operation.
MlirValue llzkFelt_OrFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::OrFeltOp Operation.
void llzkFelt_ShrFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::ShrFeltOp Operation.
MlirValue llzkFelt_NotFeltOpGetOperand(MlirOperation op)
Get Operand operand from llzk::felt::NotFeltOp Operation.
MlirValue llzkFelt_SignedIntDivFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::SignedIntDivFeltOp Operation.
MlirOperation llzkFelt_FeltConstantOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirAttribute value)
Build a llzk::felt::FeltConstantOp Operation.
MlirOperation llzkFelt_MulFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::MulFeltOp Operation.
MlirValue llzkFelt_UnsignedIntDivFeltOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::felt::UnsignedIntDivFeltOp Operation.
void llzkFelt_AndFeltOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::felt::AndFeltOp Operation.
MlirValue llzkFelt_MulFeltOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::felt::MulFeltOp Operation.
MlirOperation llzkFelt_UnsignedModFeltOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType resultType, MlirValue lhs, MlirValue rhs)
Build a llzk::felt::UnsignedModFeltOp Operation.
bool llzkOperationIsA_Felt_AddFeltOp(MlirOperation inp)
Returns true if the Operation is a llzk::felt::AddFeltOp.
void llzkFelt_NegFeltOpSetOperand(MlirOperation op, MlirValue value)
Set Operand operand of llzk::felt::NegFeltOp Operation.
void llzkFelt_PowFeltOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::felt::PowFeltOp Operation.