Skip to content

Commit a422e94

Browse files
authored
Merge branch 'master' into gd/issue_9390
2 parents 520d16f + 3679e4c commit a422e94

File tree

3 files changed

+74
-2
lines changed

3 files changed

+74
-2
lines changed

.github/benchmark_projects.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
define: &AZ_COMMIT cb2a2fa78f30f196339ca044448e415c6a9b45cc
1+
define: &AZ_COMMIT 8fd3ab3ebb75d53958ba0bd1f487b64b7548c444
22
projects:
33
private-kernel-inner:
44
repo: AztecProtocol/aztec-packages

EXTERNAL_NOIR_LIBRARIES.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
define: &AZ_COMMIT cb2a2fa78f30f196339ca044448e415c6a9b45cc
1+
define: &AZ_COMMIT 8fd3ab3ebb75d53958ba0bd1f487b64b7548c444
22
libraries:
33
noir_check_shuffle:
44
repo: noir-lang/noir_check_shuffle

compiler/noirc_evaluator/src/ssa/ir/instruction.rs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,100 @@ pub(crate) type InstructionId = Id<Instruction>;
4040
/// source code and must be processed by the IR.
4141
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
4242
pub enum Intrinsic {
43+
/// ArrayLen - returns the length of the input array
44+
/// argument: array (value id)
45+
/// result: length of the array, panic if the input is not an array
4346
ArrayLen,
47+
/// ArrayAsStrUnchecked - Converts a byte array of type `[u8; N]` to a string
48+
/// argument: array (value id)
49+
/// result: str
4450
ArrayAsStrUnchecked,
51+
/// AsSlice
52+
/// argument: value id
53+
/// result: a slice containing the elements of the argument. Panic if the value id does not correspond to an `array` type
4554
AsSlice,
55+
/// AssertConstant - Enforce the argument to be a constant value, at compile time.
56+
/// argument: value id
57+
/// result: (), panic if the argument does not resolve to a constant value
4658
AssertConstant,
59+
/// StaticAssert - Enforce the first argument to be true, at compile time
60+
/// arguments: boolean (value id), ...message. The message can be a `format string` of several arguments
61+
/// result: (), panic if the arguments do not resolve to constant values or if the first one is false.
4762
StaticAssert,
63+
/// SlicePushBack - Add elements at the end of a slice
64+
/// arguments: slice length, slice contents, ...elements_to_push
65+
/// result: a slice containing `slice contents,..elements_to_push`
4866
SlicePushBack,
67+
/// SlicePushFront - Add elements at the start of a slice
68+
/// arguments: slice length, slice contents, ...elements_to_push
69+
/// result: a slice containing `..elements_to_push, slice contents`
4970
SlicePushFront,
71+
/// SlicePopBack - Removes the last element of a slice
72+
/// arguments: slice length, slice contents
73+
/// result: a slice without the last element of `slice contents`
5074
SlicePopBack,
75+
/// SlicePopFront - Removes the first element of a slice
76+
/// arguments: slice length, slice contents
77+
/// result: a slice without the first element of `slice contents`
5178
SlicePopFront,
79+
/// SliceInsert - Insert elements inside a slice.
80+
/// arguments: slice length, slice contents, insert index, ...elements_to_insert
81+
/// result: a slice with ...elements_to_insert inserted at the `insert index`
5282
SliceInsert,
83+
/// SliceRemove - Removes an element from a slice
84+
/// arguments: slice length, slice contents, remove index
85+
/// result: a slice with without the element at `remove index`
5386
SliceRemove,
87+
/// ApplyRangeConstraint - Enforces the `bit size` of the first argument via a range check.
88+
/// arguments: value id, bit size (constant)
89+
/// result: applies a range check constraint to the input. It is replaced by a RangeCheck instruction during simplification.
5490
ApplyRangeConstraint,
91+
/// StrAsBytes - Convert a `str` into a byte array of type `[u8; N]`
92+
/// arguments: value id
93+
/// result: the argument. Internally a `str` is a byte array.
5594
StrAsBytes,
95+
/// ToBits(Endian) - Computes the bit decomposition of the argument.
96+
/// argument: a field element (value id)
97+
/// result: an array whose elements are the bit decomposition of the argument, in the endian order depending on the chosen variant.
98+
/// The type of the result gives the number of limbs to use for the decomposition.
5699
ToBits(Endian),
100+
/// ToRadix(Endian) - Decompose the first argument over the `radix` base
101+
/// arguments: a field element (value id), the radix to use (constant, a power of 2 between 2 and 256)
102+
/// result: an array whose elements are the decomposition of the argument into the `radix` base, in the endian order depending on the chosen variant.
103+
/// The type of the result gives the number of limbs to use for the decomposition.
57104
ToRadix(Endian),
105+
/// BlackBox(BlackBoxFunc) - Calls a blackbox function. More details can be found here: [acvm-repo::acir::::circuit::opcodes::BlackBoxFuncCall]
58106
BlackBox(BlackBoxFunc),
107+
/// Hint(Hint) - Avoid its arguments to be removed by DIE.
108+
/// arguments: ... value id
109+
/// result: the arguments. Hint does not layout any constraint but avoid its arguments to be simplified out during SSA transformations
59110
Hint(Hint),
111+
/// AsWitness - Adds a new witness constrained to be equal to the argument
112+
/// arguments: value id
113+
/// result: the argument
60114
AsWitness,
115+
/// IsUnconstrained - Indicates if the execution context is constrained or unconstrained
116+
/// argument: ()
117+
/// result: true if execution is under unconstrained context, false else.
61118
IsUnconstrained,
119+
/// DerivePedersenGenerators - Computes the Pedersen generators
120+
/// arguments: domain_separator_string (constant string), starting_index (constant)
121+
/// result: array of elliptic curve points (Grumpkin) containing the generators.
122+
/// The type of the result gives the number of generators to compute.
62123
DerivePedersenGenerators,
124+
/// FieldLessThan - Compare the arguments: `lhs` < `rhs`
125+
/// arguments: lhs, rhs. Field elements
126+
/// result: true if `lhs` mod p < `rhs` mod p (p being the field characteristic), false else
63127
FieldLessThan,
128+
/// ArrayRefCount - Gives the reference count of the array
129+
/// argument: array (value id)
130+
/// result: reference count of `array`. In unconstrained context, the reference count is stored alongside the array.
131+
/// in constrained context, it will be 0.
64132
ArrayRefCount,
133+
/// SliceRefCount - Gives the reference count of the slice
134+
/// argument: slice (value id)
135+
/// result: reference count of `slice`. In unconstrained context, the reference count is stored alongside the slice.
136+
/// in constrained context, it will be 0.
65137
SliceRefCount,
66138
}
67139

0 commit comments

Comments
 (0)