9#ifdef GET_ATTRDEF_CLASSES
10#undef GET_ATTRDEF_CLASSES
59struct FeltConstAttrStorage;
62class FeltConstAttr :
public ::mlir::Attribute::AttrBase<FeltConstAttr, ::mlir::Attribute, detail::FeltConstAttrStorage, ::mlir::TypedAttr::Trait> {
67 ::mlir::StringAttr getFieldName()
const;
71 std::optional<::llvm::DynamicAPInt> getReducedValue()
const;
75 ::llvm::DynamicAPInt getReducedValueOrRaw()
const;
76 static constexpr ::llvm::StringLiteral name =
"felt.const";
77 static constexpr ::llvm::StringLiteral dialectName =
"felt";
78 static FeltConstAttr get(::mlir::MLIRContext *context, ::llzk::DynamicAPIntValue rawValue, FeltType type);
79 static FeltConstAttr get(::mlir::MLIRContext *context, const ::llvm::DynamicAPInt &rawValue, FeltType ty);
80 static FeltConstAttr get(::mlir::MLIRContext *context, const ::llvm::DynamicAPInt &rawValue);
81 static FeltConstAttr get(::mlir::MLIRContext *context, const ::llvm::DynamicAPInt &rawValue, ::llvm::StringRef fieldName);
82 static FeltConstAttr get(::mlir::MLIRContext *context, ::llvm::ArrayRef<uint64_t> parts, FeltType ty);
83 static FeltConstAttr get(::mlir::MLIRContext *context, ::llvm::ArrayRef<uint64_t> parts);
84 static FeltConstAttr get(::mlir::MLIRContext *context, ::llvm::ArrayRef<uint64_t> parts, ::llvm::StringRef fieldName);
85 static constexpr ::llvm::StringLiteral getMnemonic() {
89 static ::mlir::Attribute parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType);
90 void print(::mlir::AsmPrinter &odsPrinter)
const;
91 const ::llvm::DynamicAPInt &getRawValue()
const;
92 FeltType getType()
const;
96struct FieldSpecAttrStorage;
99class FieldSpecAttr :
public ::mlir::Attribute::AttrBase<FieldSpecAttr, ::mlir::Attribute, detail::FieldSpecAttrStorage> {
102 static constexpr ::llvm::StringLiteral name =
"felt.field";
103 static constexpr ::llvm::StringLiteral dialectName =
"felt";
104 using Base::getChecked;
105 static FieldSpecAttr get(::mlir::MLIRContext *context, ::mlir::StringAttr fieldName, ::llzk::DynamicAPIntValue prime);
106 static FieldSpecAttr getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::mlir::StringAttr fieldName, ::llzk::DynamicAPIntValue prime);
107 static FieldSpecAttr get(::mlir::MLIRContext *context, ::mlir::StringAttr fieldName, const ::llvm::DynamicAPInt &prime);
108 static FieldSpecAttr getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::mlir::StringAttr fieldName, const ::llvm::DynamicAPInt &prime);
109 static FieldSpecAttr get(::mlir::MLIRContext *context, ::mlir::StringAttr fieldName, ::llvm::ArrayRef<uint64_t> parts);
110 static FieldSpecAttr getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::mlir::StringAttr fieldName, ::llvm::ArrayRef<uint64_t> parts);
111 static FieldSpecAttr get(::mlir::MLIRContext *context, ::llvm::StringRef fieldName, ::llvm::ArrayRef<uint64_t> parts);
112 static FieldSpecAttr getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::llvm::StringRef fieldName, ::llvm::ArrayRef<uint64_t> parts);
113 static ::llvm::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::StringAttr fieldName, ::llzk::DynamicAPIntValue prime);
114 static ::llvm::LogicalResult verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::StringAttr fieldName, ::llzk::DynamicAPIntValue prime);
115 static constexpr ::llvm::StringLiteral getMnemonic() {
119 static ::mlir::Attribute parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType);
120 void print(::mlir::AsmPrinter &odsPrinter)
const;
121 ::mlir::StringAttr getFieldName()
const;
122 const ::llvm::DynamicAPInt &getPrime()
const;
126MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::felt::FeltConstAttr)
127MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::felt::FieldSpecAttr)
Common interface for binary arithmetic operations on felts.