Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
addressing.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5
6namespace bb::avm2 {
7
15inline bool is_operand_relative(uint16_t indirect_flag, size_t operand_index)
16{
17 return ((indirect_flag >> (operand_index * 2 + 1)) & 1) != 0;
18}
19
27inline bool is_operand_indirect(uint16_t indirect_flag, size_t operand_index)
28{
29 return ((indirect_flag >> (operand_index * 2)) & 1) != 0;
30}
31
32} // namespace bb::avm2
bool is_operand_relative(uint16_t indirect_flag, size_t operand_index)
Checks if the operand at the given index is relative.
bool is_operand_indirect(uint16_t indirect_flag, size_t operand_index)
Checks if the operand at the given index is indirect.