LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Ops.cpp
Go to the documentation of this file.
1//===-- Ops.cpp - Felt operation implementations ----------------*- C++ -*-===//
2//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2025 Veridise Inc.
6// SPDX-License-Identifier: Apache-2.0
7//
8//===----------------------------------------------------------------------===//
9
13
14#include <mlir/IR/Builders.h>
15
16#include <llvm/ADT/SmallString.h>
17
18// TableGen'd implementation files
19#define GET_OP_CLASSES
21
22using namespace mlir;
23
24namespace llzk::felt {
25
26//===------------------------------------------------------------------===//
27// FeltConstantOp
28//===------------------------------------------------------------------===//
29
30void FeltConstantOp::getAsmResultNames(OpAsmSetValueNameFn setNameFn) {
31 llvm::SmallString<32> buf;
32 llvm::raw_svector_ostream os(buf);
33 os << "felt_const_";
34 getValue().getValue().toStringUnsigned(buf);
35 setNameFn(getResult(), buf);
36}
37
39
40//===------------------------------------------------------------------===//
41// FeltNonDetOp
42//===------------------------------------------------------------------===//
43
44void FeltNonDetOp::getAsmResultNames(OpAsmSetValueNameFn setNameFn) {
45 setNameFn(getResult(), "felt_nondet");
46}
47
48} // namespace llzk::felt
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:589
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Definition Ops.cpp:30
::mlir::OpFoldResult fold(FoldAdaptor adaptor)
Definition Ops.cpp:38
::mlir::TypedValue<::llzk::felt::FeltType > getResult()
Definition Ops.cpp.inc:833
::llzk::felt::FeltConstAttr getValue()
Definition Ops.cpp.inc:928
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Definition Ops.cpp:44
::mlir::TypedValue<::llzk::felt::FeltType > getResult()
Definition Ops.cpp.inc:1103