#[repr(C)]pub struct BranchColumns<T> {Show 19 fields
pub pc: Word<T>,
pub pc_range_checker: BabyBearWordRangeChecker<T>,
pub next_pc: Word<T>,
pub next_pc_range_checker: BabyBearWordRangeChecker<T>,
pub op_a_value: Word<T>,
pub op_b_value: Word<T>,
pub op_c_value: Word<T>,
pub op_a_0: T,
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 not_branching: T,
pub a_eq_b: T,
pub a_gt_b: T,
pub a_lt_b: T,
}Expand description
The column layout for branching.
Fields§
§pc: Word<T>The current program counter.
pc_range_checker: BabyBearWordRangeChecker<T>§next_pc: Word<T>The next program counter.
next_pc_range_checker: BabyBearWordRangeChecker<T>§op_a_value: Word<T>The value of the first operand.
op_b_value: Word<T>The value of the second operand.
op_c_value: Word<T>The value of the third operand.
op_a_0: TWhether the first operand is register 0.
is_beq: TBranch Instructions.
is_bne: T§is_blt: T§is_bge: T§is_bltu: T§is_bgeu: T§is_branching: TThe is_branching column is equal to:
is_beq & a_eq_b || is_bne & (a_lt_b | a_gt_b) || (is_blt | is_bltu) & a_lt_b || (is_bge | is_bgeu) & (a_eq_b | a_gt_b)
not_branching: TThe not branching column is equal to:
is_beq & !a_eq_b || is_bne & !(a_lt_b | a_gt_b) || (is_blt | is_bltu) & !a_lt_b || (is_bge | is_bgeu) & !(a_eq_b | a_gt_b)
Note that we probably can do away with this column and just use !is_branching. However, the branching related constraints were auditted twice when they were part of the CPU table, so I’m preserving those columns/constraints for now.
a_eq_b: TWhether a equals b.
a_gt_b: TWhether a is greater than b.
a_lt_b: TWhether a is less than b.
Trait Implementations§
Source§impl<T> Borrow<BranchColumns<T>> for [T]
impl<T> Borrow<BranchColumns<T>> for [T]
Source§fn borrow(&self) -> &BranchColumns<T>
fn borrow(&self) -> &BranchColumns<T>
Source§impl<T> BorrowMut<BranchColumns<T>> for [T]
impl<T> BorrowMut<BranchColumns<T>> for [T]
Source§fn borrow_mut(&mut self) -> &mut BranchColumns<T>
fn borrow_mut(&mut self) -> &mut BranchColumns<T>
Source§impl<T: Clone> Clone for BranchColumns<T>
impl<T: Clone> Clone for BranchColumns<T>
Source§fn clone(&self) -> BranchColumns<T>
fn clone(&self) -> BranchColumns<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for BranchColumns<T>
impl<T: Debug> Debug for BranchColumns<T>
Source§impl<T: Default> Default for BranchColumns<T>
impl<T: Default> Default for BranchColumns<T>
Source§fn default() -> BranchColumns<T>
fn default() -> BranchColumns<T>
impl<T: Copy> Copy for BranchColumns<T>
Auto Trait Implementations§
impl<T> Freeze for BranchColumns<T>where
T: Freeze,
impl<T> RefUnwindSafe for BranchColumns<T>where
T: RefUnwindSafe,
impl<T> Send for BranchColumns<T>where
T: Send,
impl<T> Sync for BranchColumns<T>where
T: Sync,
impl<T> Unpin for BranchColumns<T>where
T: Unpin,
impl<T> UnwindSafe for BranchColumns<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more