pub enum ParallelAlu {
Show 41 variants
Move,
TfrAcc {
src: Accumulator,
d: Accumulator,
},
Addr {
src: Accumulator,
d: Accumulator,
},
Tst {
d: Accumulator,
},
CmpAcc {
src: Accumulator,
d: Accumulator,
},
Subr {
src: Accumulator,
d: Accumulator,
},
CmpmAcc {
src: Accumulator,
d: Accumulator,
},
AddAcc {
src: Accumulator,
d: Accumulator,
},
Rnd {
d: Accumulator,
},
Addl {
src: Accumulator,
d: Accumulator,
},
Clr {
d: Accumulator,
},
SubAcc {
src: Accumulator,
d: Accumulator,
},
Max,
Maxm,
Subl {
src: Accumulator,
d: Accumulator,
},
Not {
d: Accumulator,
},
AddXY {
hi: usize,
lo: usize,
d: Accumulator,
},
Adc {
hi: usize,
lo: usize,
d: Accumulator,
},
SubXY {
hi: usize,
lo: usize,
d: Accumulator,
},
Sbc {
hi: usize,
lo: usize,
d: Accumulator,
},
Asr {
d: Accumulator,
},
Lsr {
d: Accumulator,
},
Abs {
d: Accumulator,
},
Ror {
d: Accumulator,
},
Asl {
d: Accumulator,
},
Lsl {
d: Accumulator,
},
Neg {
d: Accumulator,
},
Rol {
d: Accumulator,
},
AddReg {
src: usize,
d: Accumulator,
},
TfrReg {
src: usize,
d: Accumulator,
},
Or {
src: usize,
d: Accumulator,
},
Eor {
src: usize,
d: Accumulator,
},
SubReg {
src: usize,
d: Accumulator,
},
CmpReg {
src: usize,
d: Accumulator,
},
And {
src: usize,
d: Accumulator,
},
CmpmReg {
src: usize,
d: Accumulator,
},
Mpy {
negate: bool,
s1: usize,
s2: usize,
d: Accumulator,
},
Mpyr {
negate: bool,
s1: usize,
s2: usize,
d: Accumulator,
},
Mac {
negate: bool,
s1: usize,
s2: usize,
d: Accumulator,
},
Macr {
negate: bool,
s1: usize,
s2: usize,
d: Accumulator,
},
Undefined,
}Expand description
Decoded parallel ALU operation (bits 7:0 of a parallel instruction).
The encoding is defined in DSP56300FM Tables 12-19 and 12-20:
- Non-multiply (0x00-0x7F):
0 JJJ D kkk - Multiply (0x80-0xFF):
1 QQQ d kkk
Variants§
Move
0x00: No ALU operation (move-only parallel)
TfrAcc
Addr
Tst
Fields
§
d: AccumulatorCmpAcc
Subr
CmpmAcc
AddAcc
Rnd
Fields
§
d: AccumulatorAddl
Clr
Fields
§
d: AccumulatorSubAcc
Max
0x1D: always max a,b
Maxm
0x15: always maxm a,b
Subl
Not
Fields
§
d: AccumulatorAddXY
Adc
SubXY
Sbc
Asr
Fields
§
d: AccumulatorLsr
Fields
§
d: AccumulatorAbs
Fields
§
d: AccumulatorRor
Fields
§
d: AccumulatorAsl
Fields
§
d: AccumulatorLsl
Fields
§
d: AccumulatorNeg
Fields
§
d: AccumulatorRol
Fields
§
d: AccumulatorAddReg
TfrReg
Or
Eor
SubReg
CmpReg
And
CmpmReg
Mpy
Mpyr
Mac
Macr
Undefined
Undefined encoding (0x04, 0x08, 0x0C, 0x15)
Implementations§
Source§impl ParallelAlu
impl ParallelAlu
Sourcepub fn dest_accumulator(&self) -> Option<Accumulator>
pub fn dest_accumulator(&self) -> Option<Accumulator>
The destination accumulator of this ALU operation, if any.
Returns None for Move, Undefined, and comparison/test ops (Cmp*, Cmpm*, Tst).
Sourcepub fn from_text(text: &str) -> Option<ParallelAlu>
pub fn from_text(text: &str) -> Option<ParallelAlu>
Parse from the display text format (inverse of Display).
Accepts strings like "add x,a", "mpy +x0,y1,b", "move", etc.
Sourcepub fn is_logical_or_shift(&self) -> bool
pub fn is_logical_or_shift(&self) -> bool
Whether this is a logical or shift operation (writes only A1/B1, not full accumulator).
Trait Implementations§
Source§impl Clone for ParallelAlu
impl Clone for ParallelAlu
Source§fn clone(&self) -> ParallelAlu
fn clone(&self) -> ParallelAlu
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ParallelAlu
Source§impl Debug for ParallelAlu
impl Debug for ParallelAlu
Source§impl Display for ParallelAlu
impl Display for ParallelAlu
impl Eq for ParallelAlu
Source§impl PartialEq for ParallelAlu
impl PartialEq for ParallelAlu
Source§fn eq(&self, other: &ParallelAlu) -> bool
fn eq(&self, other: &ParallelAlu) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ParallelAlu
Auto Trait Implementations§
impl Freeze for ParallelAlu
impl RefUnwindSafe for ParallelAlu
impl Send for ParallelAlu
impl Sync for ParallelAlu
impl Unpin for ParallelAlu
impl UnsafeUnpin for ParallelAlu
impl UnwindSafe for ParallelAlu
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
Mutably borrows from an owned value. Read more