use sp1_derive::AlignedBorrow;
use std::mem::size_of;
use struct_reflection::{StructReflection, StructReflectionHelper};
use crate::{
adapter::{register::i_type::ITypeReader, state::CPUState},
operations::LtOperationSigned,
SupervisorMode, TrustMode, UserMode,
};
pub const NUM_BRANCH_COLS_SUPERVISOR: usize = size_of::<BranchColumns<u8, SupervisorMode>>();
pub const NUM_BRANCH_COLS_USER: usize = size_of::<BranchColumns<u8, UserMode>>();
#[derive(AlignedBorrow, Default, Debug, Clone, Copy, StructReflection)]
#[repr(C)]
pub struct BranchColumns<T, M: TrustMode> {
pub state: CPUState<T>,
pub adapter: ITypeReader<T>,
pub next_pc: [T; 3],
pub is_beq: T,
pub is_bne: T,
pub is_blt: T,
pub is_bge: T,
pub is_bltu: T,
pub is_bgeu: T,
pub is_branching: T,
pub compare_operation: LtOperationSigned<T>,
pub adapter_cols: M::AdapterCols<T>,
}