Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
internal_call_impl.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
6
7namespace bb::avm2 {
8
9template <typename FF_>
10template <typename ContainerOverSubrelations, typename AllEntities>
11void internal_callImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
12 const AllEntities& in,
13 [[maybe_unused]] const RelationParameters<FF_>&,
14 [[maybe_unused]] const FF_& scaling_factor)
15{
16 using C = ColumnAndShifts;
17
18 const auto execution_SEL_INTERNAL_OP =
19 in.get(C::execution_sel_execute_internal_call) + in.get(C::execution_sel_read_unwind_call_stack);
20
21 {
22 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
23 auto tmp = (static_cast<View>(in.get(C::execution_sel_read_unwind_call_stack)) -
24 static_cast<View>(in.get(C::execution_sel_execute_internal_return)) *
25 (FF(1) - static_cast<View>(in.get(C::execution_sel_opcode_error))));
26 std::get<0>(evals) += (tmp * scaling_factor);
27 }
28 { // INTERNAL_RET_ERROR
29 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
30 auto tmp = static_cast<View>(in.get(C::execution_sel_execute_internal_return)) *
31 ((static_cast<View>(in.get(C::execution_internal_call_return_id)) *
32 (static_cast<View>(in.get(C::execution_sel_opcode_error)) *
33 (FF(1) - static_cast<View>(in.get(C::execution_internal_call_return_id_inv))) +
34 static_cast<View>(in.get(C::execution_internal_call_return_id_inv))) -
35 FF(1)) +
36 static_cast<View>(in.get(C::execution_sel_opcode_error)));
37 std::get<1>(evals) += (tmp * scaling_factor);
38 }
39 { // NEW_CALL_ID_ON_CALL
40 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
41 auto tmp = static_cast<View>(in.get(C::execution_sel_execute_internal_call)) *
42 (static_cast<View>(in.get(C::execution_internal_call_id_shift)) -
43 static_cast<View>(in.get(C::execution_next_internal_call_id)));
44 std::get<2>(evals) += (tmp * scaling_factor);
45 }
46 { // NEW_RETURN_ID_ON_CALL
47 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
48 auto tmp = static_cast<View>(in.get(C::execution_sel_execute_internal_call)) *
49 (static_cast<View>(in.get(C::execution_internal_call_return_id_shift)) -
50 static_cast<View>(in.get(C::execution_internal_call_id)));
51 std::get<3>(evals) += (tmp * scaling_factor);
52 }
53 { // INCR_NEXT_INT_CALL_ID
54 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
55 auto tmp =
56 CView(execution_SEL_INTERNAL_OP) * (static_cast<View>(in.get(C::execution_next_internal_call_id_shift)) -
57 (static_cast<View>(in.get(C::execution_next_internal_call_id)) +
58 static_cast<View>(in.get(C::execution_sel_execute_internal_call))));
59 std::get<4>(evals) += (tmp * scaling_factor);
60 }
61}
62
63} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
ColumnAndShifts
Definition columns.hpp:34
AvmFlavorSettings::FF FF
Definition field.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
#define CView(v)
Container for parameters used by the grand product (permutation, lookup) Honk relations.