//! Generated by `gen_opcodes`, do not edit by hand.

use super::*;
#[derive(Clone, PartialEq, Eq, Copy, Hash)]
pub enum InstructionFormat {
    Unary,
    Binary,
    Branch,
    Jump,
    Call,
    PhiNode,
}
#[repr(u8)]
#[derive(Clone, PartialEq, Eq, Copy, Hash)]
pub enum Opcode {
    Inot = 1u8,
    Bnot = 2u8,
    Fneg = 3u8,
    Ineg = 4u8,
    FIcast = 5u8,
    IFcast = 6u8,
    BIcast = 7u8,
    IBcast = 8u8,
    FBcast = 9u8,
    BFcast = 10u8,
    OptBarrier = 11u8,
    Sqrt = 12u8,
    Exp = 13u8,
    Ln = 14u8,
    Log = 15u8,
    Clog2 = 16u8,
    Floor = 17u8,
    Ceil = 18u8,
    Sin = 19u8,
    Cos = 20u8,
    Tan = 21u8,
    Asin = 22u8,
    Acos = 23u8,
    Atan = 24u8,
    Sinh = 25u8,
    Cosh = 26u8,
    Tanh = 27u8,
    Asinh = 28u8,
    Acosh = 29u8,
    Atanh = 30u8,
    Iadd = 31u8,
    Isub = 32u8,
    Imul = 33u8,
    Idiv = 34u8,
    Irem = 35u8,
    Ishl = 36u8,
    Ishr = 37u8,
    Ixor = 38u8,
    Iand = 39u8,
    Ior = 40u8,
    Fadd = 41u8,
    Fsub = 42u8,
    Fmul = 43u8,
    Fdiv = 44u8,
    Frem = 45u8,
    Ilt = 46u8,
    Igt = 47u8,
    Ige = 48u8,
    Ile = 49u8,
    Flt = 50u8,
    Fgt = 51u8,
    Fge = 52u8,
    Fle = 53u8,
    Ieq = 54u8,
    Feq = 55u8,
    Seq = 56u8,
    Beq = 57u8,
    Ine = 58u8,
    Fne = 59u8,
    Sne = 60u8,
    Bne = 61u8,
    Hypot = 62u8,
    Atan2 = 63u8,
    Pow = 64u8,
    Br = 65u8,
    Jmp = 66u8,
    Call = 67u8,
    Phi = 68u8,
}
pub(super) const OPCODE_CONSTRAINTS: [OpcodeConstraints; 68usize + 1] = [
    OpcodeConstraints::new(0, 0),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(1u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(2u8, 1u8),
    OpcodeConstraints::new(1u8, 0u8),
    OpcodeConstraints::new(0u8, 0u8),
    OpcodeConstraints::new(0u8, 0u8),
    OpcodeConstraints::new(0u8, 1u8),
];
pub(super) const OPCODE_NAMES: [&str; 68usize + 1] = [
    "",
    "inot",
    "bnot",
    "fneg",
    "ineg",
    "ficast",
    "ifcast",
    "bicast",
    "ibcast",
    "fbcast",
    "bfcast",
    "optbarrier",
    "sqrt",
    "exp",
    "ln",
    "log",
    "clog2",
    "floor",
    "ceil",
    "sin",
    "cos",
    "tan",
    "asin",
    "acos",
    "atan",
    "sinh",
    "cosh",
    "tanh",
    "asinh",
    "acosh",
    "atanh",
    "iadd",
    "isub",
    "imul",
    "idiv",
    "irem",
    "ishl",
    "ishr",
    "ixor",
    "iand",
    "ior",
    "fadd",
    "fsub",
    "fmul",
    "fdiv",
    "frem",
    "ilt",
    "igt",
    "ige",
    "ile",
    "flt",
    "fgt",
    "fge",
    "fle",
    "ieq",
    "feq",
    "seq",
    "beq",
    "ine",
    "fne",
    "sne",
    "bne",
    "hypot",
    "atan2",
    "pow",
    "br",
    "jmp",
    "call",
    "phi",
];
pub(super) const OPCODE_FORMAT: [InstructionFormat; 68usize + 1] = [
    InstructionFormat::Binary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Unary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Binary,
    InstructionFormat::Branch,
    InstructionFormat::Jump,
    InstructionFormat::Call,
    InstructionFormat::PhiNode,
];
impl std::str::FromStr for Opcode {
    type Err = &'static str;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s {
            "inot" => Ok(Opcode::Inot),
            "bnot" => Ok(Opcode::Bnot),
            "fneg" => Ok(Opcode::Fneg),
            "ineg" => Ok(Opcode::Ineg),
            "ficast" => Ok(Opcode::FIcast),
            "ifcast" => Ok(Opcode::IFcast),
            "bicast" => Ok(Opcode::BIcast),
            "ibcast" => Ok(Opcode::IBcast),
            "fbcast" => Ok(Opcode::FBcast),
            "bfcast" => Ok(Opcode::BFcast),
            "optbarrier" => Ok(Opcode::OptBarrier),
            "sqrt" => Ok(Opcode::Sqrt),
            "exp" => Ok(Opcode::Exp),
            "ln" => Ok(Opcode::Ln),
            "log" => Ok(Opcode::Log),
            "clog2" => Ok(Opcode::Clog2),
            "floor" => Ok(Opcode::Floor),
            "ceil" => Ok(Opcode::Ceil),
            "sin" => Ok(Opcode::Sin),
            "cos" => Ok(Opcode::Cos),
            "tan" => Ok(Opcode::Tan),
            "asin" => Ok(Opcode::Asin),
            "acos" => Ok(Opcode::Acos),
            "atan" => Ok(Opcode::Atan),
            "sinh" => Ok(Opcode::Sinh),
            "cosh" => Ok(Opcode::Cosh),
            "tanh" => Ok(Opcode::Tanh),
            "asinh" => Ok(Opcode::Asinh),
            "acosh" => Ok(Opcode::Acosh),
            "atanh" => Ok(Opcode::Atanh),
            "iadd" => Ok(Opcode::Iadd),
            "isub" => Ok(Opcode::Isub),
            "imul" => Ok(Opcode::Imul),
            "idiv" => Ok(Opcode::Idiv),
            "irem" => Ok(Opcode::Irem),
            "ishl" => Ok(Opcode::Ishl),
            "ishr" => Ok(Opcode::Ishr),
            "ixor" => Ok(Opcode::Ixor),
            "iand" => Ok(Opcode::Iand),
            "ior" => Ok(Opcode::Ior),
            "fadd" => Ok(Opcode::Fadd),
            "fsub" => Ok(Opcode::Fsub),
            "fmul" => Ok(Opcode::Fmul),
            "fdiv" => Ok(Opcode::Fdiv),
            "frem" => Ok(Opcode::Frem),
            "ilt" => Ok(Opcode::Ilt),
            "igt" => Ok(Opcode::Igt),
            "ige" => Ok(Opcode::Ige),
            "ile" => Ok(Opcode::Ile),
            "flt" => Ok(Opcode::Flt),
            "fgt" => Ok(Opcode::Fgt),
            "fge" => Ok(Opcode::Fge),
            "fle" => Ok(Opcode::Fle),
            "ieq" => Ok(Opcode::Ieq),
            "feq" => Ok(Opcode::Feq),
            "seq" => Ok(Opcode::Seq),
            "beq" => Ok(Opcode::Beq),
            "ine" => Ok(Opcode::Ine),
            "fne" => Ok(Opcode::Fne),
            "sne" => Ok(Opcode::Sne),
            "bne" => Ok(Opcode::Bne),
            "hypot" => Ok(Opcode::Hypot),
            "atan2" => Ok(Opcode::Atan2),
            "pow" => Ok(Opcode::Pow),
            "br" => Ok(Opcode::Br),
            "jmp" => Ok(Opcode::Jmp),
            "call" => Ok(Opcode::Call),
            "phi" => Ok(Opcode::Phi),
            _ => Err("Unknown opcode"),
        }
    }
}
