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
20
21// TableGen'd implementation files
22#define GET_OP_CLASSES
24
25using namespace mlir;
26
27namespace llzk::felt {
28
29//===------------------------------------------------------------------===//
30// FeltConstantOp
31//===------------------------------------------------------------------===//
32
33void FeltConstantOp::getAsmResultNames(OpAsmSetValueNameFn setNameFn) {
34 llvm::SmallString<32> buf;
35 llvm::raw_svector_ostream os(buf);
36 os << "felt_const_";
37 getValue().toStringUnsigned(buf);
38 setNameFn(getResult(), buf);
39}
40
42
43//===------------------------------------------------------------------===//
44// FeltNonDetOp
45//===------------------------------------------------------------------===//
46
47void FeltNonDetOp::getAsmResultNames(OpAsmSetValueNameFn setNameFn) {
48 setNameFn(getResult(), "felt_nondet");
49}
50
51} // namespace llzk::felt
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:733
::llvm::APInt getValue()
Definition Ops.cpp.inc:714
::llzk::felt::FeltConstAttr getValueAttr()
Definition Ops.h.inc:785
::mlir::TypedValue<::llzk::felt::FeltType > getResult()
Definition Ops.h.inc:772
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Definition Ops.cpp:33
::mlir::OpFoldResult fold(FoldAdaptor adaptor)
Definition Ops.cpp:41
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Definition Ops.cpp:47
::mlir::TypedValue<::llzk::felt::FeltType > getResult()
Definition Ops.h.inc:931