Skip to content

Commit

Permalink
Fix new mov syntax, fix typo in mov parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
CBJamo committed Sep 23, 2024
1 parent 276bdb6 commit 72a5a7d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pio-parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl<'i> ParsedOperands<'i> {
InstructionOperands::MOVTORX { index }
}
(MovSrcInternal::Fifo(index), MovDestInternal::Mov(MovDestination::OSR)) => {
InstructionOperands::MOVTORX { index }
InstructionOperands::MOVFROMRX { index }
}
(MovSrcInternal::Mov(s), MovDestInternal::Mov(d)) => InstructionOperands::MOV {
destination: d,
Expand Down Expand Up @@ -537,8 +537,8 @@ fn test_rp2350() {
let p = Parser::<32>::parse_program(
"
label:
mov osr, rxfifo0
mov rxfifo1, isr
mov osr, rxfifo[0]
mov rxfifo[1], isr
mov pins, isr
mov osr, x
jmp label
Expand Down
20 changes: 10 additions & 10 deletions pio-parser/src/rp2350.lalrpop
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,11 @@ ParsedMovDestination: ParsedMovDestination = {
"pc" => ParsedMovDestination::PC,
"isr" => ParsedMovDestination::ISR,
"osr" => ParsedMovDestination::OSR,
"rxfifoy" => ParsedMovDestination::RXFIFOY,
"rxfifo0" => ParsedMovDestination::RXFIFO0,
"rxfifo1" => ParsedMovDestination::RXFIFO1,
"rxfifo2" => ParsedMovDestination::RXFIFO2,
"rxfifo3" => ParsedMovDestination::RXFIFO3,
"rxfifo[y]" => ParsedMovDestination::RXFIFOY,
"rxfifo[0]" => ParsedMovDestination::RXFIFO0,
"rxfifo[1]" => ParsedMovDestination::RXFIFO1,
"rxfifo[2]" => ParsedMovDestination::RXFIFO2,
"rxfifo[3]" => ParsedMovDestination::RXFIFO3,
};

MovOperation: MovOperation = {
Expand All @@ -277,11 +277,11 @@ ParsedMovSource: ParsedMovSource = {
"status" => ParsedMovSource::STATUS,
"isr" => ParsedMovSource::ISR,
"osr" => ParsedMovSource::OSR,
"rxfifoy" => ParsedMovSource::RXFIFOY,
"rxfifo0" => ParsedMovSource::RXFIFO0,
"rxfifo1" => ParsedMovSource::RXFIFO1,
"rxfifo2" => ParsedMovSource::RXFIFO2,
"rxfifo3" => ParsedMovSource::RXFIFO3,
"rxfifo[y]" => ParsedMovSource::RXFIFOY,
"rxfifo[0]" => ParsedMovSource::RXFIFO0,
"rxfifo[1]" => ParsedMovSource::RXFIFO1,
"rxfifo[2]" => ParsedMovSource::RXFIFO2,
"rxfifo[3]" => ParsedMovSource::RXFIFO3,
};

IrqModifier: (bool, bool) = {
Expand Down

0 comments on commit 72a5a7d

Please sign in to comment.