Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
alu.hpp
Go to the documentation of this file.
1#pragma once
2
7
8namespace bb::avm2::simulation {
9
11 public:
12 virtual ~AluInterface() = default;
13 virtual MemoryValue add(const MemoryValue& a, const MemoryValue& b) = 0;
14 virtual MemoryValue sub(const MemoryValue& a, const MemoryValue& b) = 0;
15 virtual MemoryValue mul(const MemoryValue& a, const MemoryValue& b) = 0;
16 virtual MemoryValue div(const MemoryValue& a, const MemoryValue& b) = 0;
17 virtual MemoryValue fdiv(const MemoryValue& a, const MemoryValue& b) = 0;
18 virtual MemoryValue eq(const MemoryValue& a, const MemoryValue& b) = 0;
19 virtual MemoryValue lt(const MemoryValue& a, const MemoryValue& b) = 0;
20 virtual MemoryValue lte(const MemoryValue& a, const MemoryValue& b) = 0;
21 virtual MemoryValue op_not(const MemoryValue& a) = 0;
22 virtual MemoryValue truncate(const FF& a, MemoryTag dst_tag) = 0;
23 virtual MemoryValue shr(const MemoryValue& a, const MemoryValue& b) = 0;
24 virtual MemoryValue shl(const MemoryValue& a, const MemoryValue& b) = 0;
25};
26
58
59} // namespace bb::avm2::simulation
MemoryTag dst_tag
MemoryValue lte(const MemoryValue &a, const MemoryValue &b) override
Definition alu.cpp:152
Alu(GreaterThanInterface &greater_than, FieldGreaterThanInterface &field_gt, RangeCheckInterface &range_check, EventEmitterInterface< AluEvent > &event_emitter)
Definition alu.hpp:29
RangeCheckInterface & range_check
Definition alu.hpp:55
MemoryValue fdiv(const MemoryValue &a, const MemoryValue &b) override
Definition alu.cpp:100
MemoryValue truncate(const FF &a, MemoryTag dst_tag) override
Definition alu.cpp:236
MemoryValue eq(const MemoryValue &a, const MemoryValue &b) override
Definition alu.cpp:124
MemoryValue lt(const MemoryValue &a, const MemoryValue &b) override
Definition alu.cpp:137
MemoryValue shl(const MemoryValue &a, const MemoryValue &b) override
Definition alu.cpp:180
MemoryValue add(const MemoryValue &a, const MemoryValue &b) override
Definition alu.cpp:12
MemoryValue sub(const MemoryValue &a, const MemoryValue &b) override
Definition alu.cpp:24
FieldGreaterThanInterface & field_gt
Definition alu.hpp:54
MemoryValue mul(const MemoryValue &a, const MemoryValue &b) override
Definition alu.cpp:36
MemoryValue shr(const MemoryValue &a, const MemoryValue &b) override
Definition alu.cpp:208
EventEmitterInterface< AluEvent > & events
Definition alu.hpp:56
MemoryValue op_not(const MemoryValue &a) override
Definition alu.cpp:168
GreaterThanInterface & greater_than
Definition alu.hpp:53
MemoryValue div(const MemoryValue &a, const MemoryValue &b) override
Definition alu.cpp:64
virtual MemoryValue lt(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue add(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue mul(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue shl(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue fdiv(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue div(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue op_not(const MemoryValue &a)=0
virtual MemoryValue lte(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue shr(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue eq(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue sub(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue truncate(const FF &a, MemoryTag dst_tag)=0
EventEmitter< DataCopyEvent > event_emitter
FF a
FF b
AvmFlavorSettings::FF FF
Definition field.hpp:10