LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Felt.h
Go to the documentation of this file.
1//===-- Felt.h - C API for Felt dialect ---------------------------*- 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//
10// This header declares the C interface for registering and accessing the
11// Felt dialect. A dialect should be registered with a context to make it
12// available to users of the context. These users must load the dialect
13// before using any of its attributes, operations, or types. Parser and pass
14// manager can load registered dialects automatically.
15//
16//===----------------------------------------------------------------------===//
17
18#ifndef LLZK_C_DIALECT_FELT_H
19#define LLZK_C_DIALECT_FELT_H
20
21#include "llzk-c/Support.h"
22
23#include <mlir-c/IR.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
30
32MLIR_CAPI_EXPORTED MlirAttribute llzkFeltConstAttrGet(MlirContext context, int64_t value);
33
35MLIR_CAPI_EXPORTED MlirAttribute
36llzkFeltConstAttrGetWithBits(MlirContext ctx, unsigned numBits, int64_t value);
37
39MLIR_CAPI_EXPORTED MlirAttribute
40llzkFeltConstAttrGetFromString(MlirContext context, unsigned numBits, MlirStringRef str);
41
43MLIR_CAPI_EXPORTED MlirAttribute llzkFeltConstAttrGetFromParts(
44 MlirContext context, unsigned numBits, const uint64_t *parts, intptr_t nParts
45);
46
48LLZK_DECLARE_ATTR_ISA(FeltConstAttr);
49
51MLIR_CAPI_EXPORTED MlirType llzkFeltTypeGet(MlirContext context);
52
55
56#ifdef __cplusplus
57}
58#endif
59
60#endif
MLIR_CAPI_EXPORTED MlirAttribute llzkFeltConstAttrGet(MlirContext context, int64_t value)
Creates a llzk::felt::FeltConstAttr.
Definition Felt.cpp:24
MLIR_CAPI_EXPORTED MlirAttribute llzkFeltConstAttrGetFromString(MlirContext context, unsigned numBits, MlirStringRef str)
Creates a llzk::felt::FeltConstAttr from a base-10 representation of a number.
Definition Felt.cpp:32
MLIR_CAPI_EXPORTED MlirAttribute llzkFeltConstAttrGetWithBits(MlirContext ctx, unsigned numBits, int64_t value)
Creates a llzk::felt::FeltConstAttr with a set bit length.
Definition Felt.cpp:28
MLIR_CAPI_EXPORTED MlirType llzkFeltTypeGet(MlirContext context)
Creates a llzk::felt::FeltType.
Definition Felt.cpp:46
MLIR_CAPI_EXPORTED MlirAttribute llzkFeltConstAttrGetFromParts(MlirContext context, unsigned numBits, const uint64_t *parts, intptr_t nParts)
Creates a llzk::felt::FeltConstAttr from an array of big-integer parts in LSB order.
Definition Felt.cpp:36
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Felt, llzk__felt)
#define LLZK_DECLARE_ATTR_ISA(what)
Definition Support.h:49
#define LLZK_DECLARE_TYPE_ISA(what)
Definition Support.h:47