insou22 / mipsy

Education-focused MIPS Emulator written in Rust.
87 stars 13 forks source link

Unexpected behaviour of SEQ and SNE #284

Closed abu-co closed 1 year ago

abu-co commented 1 year ago

Consider the instruction

seq $t0, $t0, 42

which gets expanded into

0x00400000 [0x2001002a]    addi   $at, $zero, 42
0x00400004 [0x34080001]    ori    $t0, $zero, 1
0x00400008 [0x11010002]    beq    $t0, $at, 2
0x0040000c [0x34080000]    ori    $t0, $zero, 0

due to this rule: https://github.com/insou22/mipsy/blob/90ea695d02c69978a293182bd941d1d08a5b540b/mips.yaml#L1741-L1750

However, $t0 will always end up being 1 as 1 != 42, irrespective of the actual value it originally contains.

I wonder if this behaviour is correct?

Dylan-Brotherston commented 1 year ago

discussion here: #283

Dylan-Brotherston commented 1 year ago

Fixed in #287