3#include "barretenberg/aztec/aztec_constants.hpp"
19 {
WireOpCode::ADD_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
20 {
WireOpCode::ADD_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
21 {
WireOpCode::SUB_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
22 {
WireOpCode::SUB_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
23 {
WireOpCode::MUL_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
24 {
WireOpCode::MUL_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
25 {
WireOpCode::DIV_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
26 {
WireOpCode::DIV_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
27 {
WireOpCode::FDIV_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
28 {
WireOpCode::FDIV_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
29 {
WireOpCode::EQ_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
30 {
WireOpCode::EQ_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
31 {
WireOpCode::LT_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
32 {
WireOpCode::LT_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
33 {
WireOpCode::LTE_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
34 {
WireOpCode::LTE_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
35 {
WireOpCode::AND_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
36 {
WireOpCode::AND_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
37 {
WireOpCode::OR_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
38 {
WireOpCode::OR_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
39 {
WireOpCode::XOR_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
40 {
WireOpCode::XOR_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
41 {
WireOpCode::NOT_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
42 {
WireOpCode::NOT_16, { 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
43 {
WireOpCode::SHL_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
44 {
WireOpCode::SHL_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
45 {
WireOpCode::SHR_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
46 {
WireOpCode::SHR_16, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
47 {
WireOpCode::CAST_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
48 {
WireOpCode::CAST_16, { 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
50 {
WireOpCode::GETENVVAR_16, { 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 } },
52 {
WireOpCode::CALLDATACOPY, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
53 {
WireOpCode::SUCCESSCOPY, { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
54 {
WireOpCode::RETURNDATASIZE, { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
55 {
WireOpCode::RETURNDATACOPY, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
58 {
WireOpCode::JUMP_32, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 } },
59 {
WireOpCode::JUMPI_32, { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } },
60 {
WireOpCode::INTERNALCALL, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 } },
61 {
WireOpCode::INTERNALRETURN, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
63 {
WireOpCode::SET_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } },
64 {
WireOpCode::SET_16, { 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 } },
65 {
WireOpCode::SET_32, { 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0 } },
66 {
WireOpCode::SET_64, { 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 } },
67 {
WireOpCode::SET_128, { 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0 } },
68 {
WireOpCode::SET_FF, { 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0 } },
69 {
WireOpCode::MOV_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
70 {
WireOpCode::MOV_16, { 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
72 {
WireOpCode::SLOAD, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
73 {
WireOpCode::SSTORE, { 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
74 {
WireOpCode::NOTEHASHEXISTS, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
75 {
WireOpCode::EMITNOTEHASH, { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
76 {
WireOpCode::NULLIFIEREXISTS, { 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
77 {
WireOpCode::EMITNULLIFIER, { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
78 {
WireOpCode::L1TOL2MSGEXISTS, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
79 {
WireOpCode::GETCONTRACTINSTANCE, { 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
81 {
WireOpCode::EMITPUBLICLOG, { 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
82 {
WireOpCode::SENDL2TOL1MSG, { 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
84 {
WireOpCode::CALL, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
85 {
WireOpCode::STATICCALL, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
86 {
WireOpCode::RETURN, { 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
87 {
WireOpCode::REVERT_8, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
88 {
WireOpCode::REVERT_16, { 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
90 {
WireOpCode::DEBUGLOG, { 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
92 {
WireOpCode::POSEIDON2PERM, { 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
93 {
WireOpCode::SHA256COMPRESSION, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
94 {
WireOpCode::KECCAKF1600, { 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
95 {
WireOpCode::ECADD, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
97 {
WireOpCode::TORADIXBE, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
99 return WireOpCode_DC_SELECTORS;
226 .tag_operand_idx = 3,
233 .tag_operand_idx = 3,
283 .tag_operand_idx = 2,
290 .tag_operand_idx = 2,
297 .tag_operand_idx = 2,
304 .tag_operand_idx = 2,
311 .tag_operand_idx = 2,
318 .tag_operand_idx = 2,
424 return WIRE_INSTRUCTION_SPEC;
472 { .num_addresses = 3,
473 .gas_cost = { .opcode_gas = AVM_ADD_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
479 { .num_addresses = 3,
480 .gas_cost = { .opcode_gas = AVM_SUB_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
486 { .num_addresses = 3,
487 .gas_cost = { .opcode_gas = AVM_MUL_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
493 { .num_addresses = 3,
494 .gas_cost = { .opcode_gas = AVM_DIV_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
500 { .num_addresses = 3,
501 .gas_cost = { .opcode_gas = AVM_FDIV_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
507 { .num_addresses = 3,
508 .gas_cost = { .opcode_gas = AVM_EQ_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
514 { .num_addresses = 3,
515 .gas_cost = { .opcode_gas = AVM_LT_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
521 { .num_addresses = 3,
522 .gas_cost = { .opcode_gas = AVM_LTE_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
528 { .num_addresses = 3,
529 .gas_cost = { .opcode_gas = AVM_AND_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
534 { .num_addresses = 3,
535 .gas_cost = { .opcode_gas = AVM_OR_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
540 { .num_addresses = 3,
541 .gas_cost = { .opcode_gas = AVM_XOR_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
546 { .num_addresses = 2,
547 .gas_cost = { .opcode_gas = AVM_NOT_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
550 { .num_addresses = 3,
551 .gas_cost = { .opcode_gas = AVM_SHL_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
557 { .num_addresses = 3,
558 .gas_cost = { .opcode_gas = AVM_SHR_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
564 { .num_addresses = 2,
565 .gas_cost = { .opcode_gas = AVM_CAST_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
568 { .num_addresses = 1,
569 .gas_cost = { .opcode_gas = AVM_GETENVVAR_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
572 { .num_addresses = 3,
573 .gas_cost = { .opcode_gas = AVM_CALLDATACOPY_BASE_L2_GAS,
575 .dyn_l2 = AVM_CALLDATACOPY_DYN_L2_GAS,
577 .dyn_gas_id = AVM_DYN_GAS_ID_CALLDATACOPY,
581 { .num_addresses = 1,
582 .gas_cost = { .opcode_gas = AVM_SUCCESSCOPY_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
585 { .num_addresses = 1,
586 .gas_cost = { .opcode_gas = AVM_RETURNDATASIZE_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
589 { .num_addresses = 3,
590 .gas_cost = { .opcode_gas = AVM_RETURNDATACOPY_BASE_L2_GAS,
592 .dyn_l2 = AVM_RETURNDATACOPY_DYN_L2_GAS,
594 .dyn_gas_id = AVM_DYN_GAS_ID_RETURNDATACOPY,
598 { .num_addresses = 0,
599 .gas_cost = { .opcode_gas = AVM_JUMP_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 } } },
601 { .num_addresses = 1,
602 .gas_cost = { .opcode_gas = AVM_JUMPI_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
607 .gas_cost = { .opcode_gas = AVM_INTERNALCALL_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
610 { .num_addresses = 0,
611 .gas_cost = { .opcode_gas = AVM_INTERNALRETURN_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 } } },
613 { .num_addresses = 1,
614 .gas_cost = { .opcode_gas = AVM_SET_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
617 { .num_addresses = 2,
618 .gas_cost = { .opcode_gas = AVM_MOV_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
621 { .num_addresses = 3,
622 .gas_cost = { .opcode_gas = AVM_SLOAD_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
627 { .num_addresses = 2,
628 .gas_cost = { .opcode_gas = AVM_SSTORE_BASE_L2_GAS,
631 .dyn_da = AVM_SSTORE_DYN_DA_GAS },
632 .dyn_gas_id = AVM_DYN_GAS_ID_SSTORE,
635 { .num_addresses = 3,
636 .gas_cost = { .opcode_gas = AVM_NOTEHASHEXISTS_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
641 { .num_addresses = 1,
642 .gas_cost = { .opcode_gas = AVM_EMITNOTEHASH_BASE_L2_GAS,
643 .base_da = AVM_EMITNOTEHASH_BASE_DA_GAS,
648 { .num_addresses = 2,
649 .gas_cost = { .opcode_gas = AVM_NULLIFIEREXISTS_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
652 { .num_addresses = 1,
653 .gas_cost = { .opcode_gas = AVM_EMITNULLIFIER_BASE_L2_GAS,
654 .base_da = AVM_EMITNULLIFIER_BASE_DA_GAS,
659 { .num_addresses = 3,
660 .gas_cost = { .opcode_gas = AVM_L1TOL2MSGEXISTS_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
665 { .num_addresses = 2,
666 .gas_cost = { .opcode_gas = AVM_GETCONTRACTINSTANCE_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
669 { .num_addresses = 2,
670 .gas_cost = { .opcode_gas = AVM_EMITPUBLICLOG_BASE_L2_GAS,
671 .base_da = AVM_EMITPUBLICLOG_BASE_DA_GAS,
672 .dyn_l2 = AVM_EMITPUBLICLOG_DYN_L2_GAS,
673 .dyn_da = AVM_EMITPUBLICLOG_DYN_DA_GAS },
674 .dyn_gas_id = AVM_DYN_GAS_ID_EMITPUBLICLOG,
677 { .num_addresses = 2,
678 .gas_cost = { .opcode_gas = AVM_SENDL2TOL1MSG_BASE_L2_GAS,
679 .base_da = AVM_SENDL2TOL1MSG_BASE_DA_GAS,
685 { .num_addresses = 5,
686 .gas_cost = { .opcode_gas = AVM_CALL_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
692 { .num_addresses = 5,
693 .gas_cost = { .opcode_gas = AVM_STATICCALL_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
699 { .num_addresses = 2,
700 .gas_cost = { .opcode_gas = AVM_RETURN_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
703 { .num_addresses = 2,
704 .gas_cost = { .opcode_gas = AVM_REVERT_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
707 { .num_addresses = 4,
708 .gas_cost = { .opcode_gas = AVM_DEBUGLOG_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
712 { .num_addresses = 2,
713 .gas_cost = { .opcode_gas = AVM_POSEIDON2_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 } } },
715 { .num_addresses = 3,
716 .gas_cost = { .opcode_gas = AVM_SHA256COMPRESSION_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 } } },
718 { .num_addresses = 2,
719 .gas_cost = { .opcode_gas = AVM_KECCAKF1600_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 } } },
721 { .num_addresses = 5,
722 .gas_cost = { .opcode_gas = AVM_ECADD_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 },
728 { .num_addresses = 5,
729 .gas_cost = { .opcode_gas = AVM_TORADIXBE_BASE_L2_GAS,
731 .dyn_l2 = AVM_TORADIXBE_DYN_L2_GAS,
733 .dyn_gas_id = AVM_DYN_GAS_ID_TORADIX,
739 return EXEC_INSTRUCTION_SPEC;
bool is_active(size_t index) const
bool need_tag_check(size_t index) const
RegisterInfo & add_output()
RegisterInfo & add_inputs(const std::vector< std::optional< ValueTag > > &tags)
size_t total_registers() const
std::optional< ValueTag > expected_tag(size_t index) const
bool is_write(size_t index) const
RegisterInfo & add_input(std::optional< ValueTag > tag=std::nullopt)
static constexpr auto ANY_TAG
std::vector< std::optional< ValueTag > > inputs
const std::unordered_map< WireOpCode, WireInstructionSpec > & get_wire_instruction_spec()
const std::unordered_map< ExecutionOpCode, ExecInstructionSpec > & get_exec_instruction_spec()
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept