#![allow(clippy::type_complexity)]
#![allow(clippy::needless_range_loop)]
use openvm_instructions::UsizeOpcode;
use openvm_instructions_derive::UsizeOpcode;
use openvm_rv32im_transpiler::BranchEqualOpcode;
use strum::{EnumCount, EnumIter, FromRepr, IntoEnumIterator};
extern crate alloc;
extern crate core;
pub mod asm;
pub mod constraints;
pub mod conversion;
pub mod ir;
pub mod prelude {
pub use openvm_native_compiler_derive::{DslVariable, Hintable};
pub use crate::{asm::AsmCompiler, ir::*};
}
#[derive(
Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, EnumCount, EnumIter, FromRepr, UsizeOpcode,
)]
#[opcode_offset = 0x100]
#[repr(usize)]
pub enum NativeLoadStoreOpcode {
LOADW,
STOREW,
LOADW2,
STOREW2,
SHINTW,
}
#[derive(Copy, Clone, Debug, UsizeOpcode)]
#[opcode_offset = 0x110]
pub struct NativeBranchEqualOpcode(pub BranchEqualOpcode);
impl NativeBranchEqualOpcode {
pub fn iter() -> impl Iterator<Item = Self> {
BranchEqualOpcode::iter().map(Self)
}
}
#[derive(
Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, EnumCount, EnumIter, FromRepr, UsizeOpcode,
)]
#[opcode_offset = 0x115]
#[repr(usize)]
pub enum NativeJalOpcode {
JAL,
}
#[derive(
Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, EnumCount, EnumIter, FromRepr, UsizeOpcode,
)]
#[opcode_offset = 0x125]
#[repr(usize)]
pub enum CastfOpcode {
CASTF,
}
#[derive(
Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, EnumCount, EnumIter, FromRepr, UsizeOpcode,
)]
#[opcode_offset = 0x130]
#[repr(usize)]
pub enum FieldArithmeticOpcode {
ADD,
SUB,
MUL,
DIV,
}
#[derive(
Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, EnumCount, EnumIter, FromRepr, UsizeOpcode,
)]
#[opcode_offset = 0x140]
#[repr(usize)]
pub enum FieldExtensionOpcode {
FE4ADD,
FE4SUB,
BBE4MUL,
BBE4DIV,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, FromRepr)]
#[repr(u16)]
pub enum NativePhantom {
Print = 0x10,
HintInput,
HintBits,
}
#[derive(
Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, EnumCount, EnumIter, FromRepr, UsizeOpcode,
)]
#[opcode_offset = 0x160]
#[repr(usize)]
#[allow(non_camel_case_types)]
pub enum FriOpcode {
FRI_REDUCED_OPENING,
}