use crate::emulator::instructions::functions::*;
use crate::emulator::instructions::*;
pub const JUMP_COMMON_INSTRUCTIONS: [SimpleIsaInstruction; 58] = [
SimpleIsaInstruction {
function: sub_jump_zero,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<SUB_JUMP_ZERO>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: sub_jump_neg,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<SUB_JUMP_NEGATIVE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: sub_jump_pos,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<SUB_JUMP_POSITIVE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: sub_jump_overflow,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<SUB_JUMP_OVERFLOW>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: sub_jump_borrow,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<SUB_JUMP_BORROW>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: and_jump_zero,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<AND_JUMP_ZERO>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: or_jump_zero,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<OR_JUMP_ZERO>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: xor_jump_zero,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<XOR_JUMP_ZERO>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: add_jump_zero,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<ADD_JUMP_ZERO>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: add_jump_neg,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<ADD_JUMP_NEGATIVE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: add_jump_pos,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<ADD_JUMP_POSITIVE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: add_jump_overflow,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<ADD_JUMP_OVERFLOW>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: add_jump_carry,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<ADD_JUMP_CARRY>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: test_bit_jump_true,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<TEST_BIT_JUMP_TRUE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: test_bits_and_jump_true,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<TEST_BITS_AND_JUMP_TRUE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: test_bits_or_jump_true,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<TEST_BITS_OR_JUMP_TRUE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: compare_jump_equal,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<COMPARE_JUMP_EQUAL>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: compare_jump_signed_below,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<COMPARE_JUMP_SIGNED_BELOW>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: compare_jump_signed_above,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<COMPARE_JUMP_SIGNED_ABOVE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: compare_jump_unsigned_below,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<COMPARE_JUMP_UNSIGNED_BELOW>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: compare_jump_unsigned_above,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<COMPARE_JUMP_UNSIGNED_ABOVE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
UNSPECIFIED_INSTRUCTION,
UNSPECIFIED_INSTRUCTION,
UNSPECIFIED_INSTRUCTION,
UNSPECIFIED_INSTRUCTION,
UNSPECIFIED_INSTRUCTION,
UNSPECIFIED_INSTRUCTION,
SimpleIsaInstruction {
function: increment_compare_jump_below,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<INCREMENT_COMPARE_JUMP_BELOW>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: increment_compare_jump_above,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<INCREMENT_COMPARE_JUMP_ABOVE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: sub_max_len_jump_pos,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
SimpleIsaInstruction {
function: inverted::<SUB_MAX_LENGTH_JUMP_POSITIVE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
UNSPECIFIED_INSTRUCTION,
UNSPECIFIED_INSTRUCTION,
UNSPECIFIED_INSTRUCTION,
UNSPECIFIED_INSTRUCTION,
];
pub const JUMP_VECTOR_INSTRUCTIONS: [(SimpleIsaInstruction, bool); 58] = [
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(
SimpleIsaInstruction {
function: and_jump_zero,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(
SimpleIsaInstruction {
function: inverted::<AND_JUMP_ZERO>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(
SimpleIsaInstruction {
function: or_jump_zero,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(
SimpleIsaInstruction {
function: inverted::<OR_JUMP_ZERO>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(
SimpleIsaInstruction {
function: xor_jump_zero,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(
SimpleIsaInstruction {
function: inverted::<XOR_JUMP_ZERO>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(
SimpleIsaInstruction {
function: test_bit_jump_true,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(
SimpleIsaInstruction {
function: inverted::<TEST_BIT_JUMP_TRUE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(
SimpleIsaInstruction {
function: test_bits_and_jump_true,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(
SimpleIsaInstruction {
function: inverted::<TEST_BITS_AND_JUMP_TRUE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(
SimpleIsaInstruction {
function: test_bits_or_jump_true,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(
SimpleIsaInstruction {
function: inverted::<TEST_BITS_OR_JUMP_TRUE>,
inputs: 2,
instr_type: instruction_type::BRANCH,
instruction_flags: instruction_flags::REG_OUT | instruction_flags::BR_TYPE_CONDITIONAL,
..SimpleIsaInstruction::DEFAULT
},
true,
),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(NOT_YET_IMPLEMENTED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
(UNSPECIFIED_INSTRUCTION, false),
];