-
Notifications
You must be signed in to change notification settings - Fork 141
Add MIPS32 accumulating instructions #282
Comments
@AndrewSultan The idea of this instructions is to have an additional ALU which operates over HI/LO registers. To model it, you have to introduce new interfaces to RF class which does addition or subtraction instead of simple overwrite. Additionally, such instructions cannot deliver data to bypass logic. Please consult with @denislos to understand the best way to change model properly. |
For an unknown reason the madd test failed, but maddu test passed. |
mipt-mips/simulator/func_sim/rf/rf.h Line 47 in 355fec1
That looks suspicious, as all operations are unsigned. However I don't see an obvious bug... What are the operands for failing test, actual output, and expected output? |
0x400b54: madd $a0, $a0 [ $hi = 0x1, $lo = 0x0 ] Actual msg: |
Double-check that condition: mipt-mips/simulator/core/perf_instr.h Line 24 in 355fec1
|
Denis @denislos, could you please take a look? It seems that MADD bypasses |
mipt-mips/simulator/mips/mips_instr.h Line 259 in 4886070
BTW, you don't need these functions as they do the same thing as |
There is a strange thing, I have run the tests and got this fetch cycle 2491: 0x400b3c: 0x0x400b3c: mfhi $v1 decode cycle 2492: 0x400b3c: mfhi $v1 (data hazard) decode cycle 2493: 0x400b3c: mfhi $v1 (data hazard) It looks like that the fetch stage does not handle stalls in case of a cache miss. I have changed Now it passes all the tests. |
@denislos Thank you for your prompt response. |
@AndrewSultan Do you have the same message as Denis has? |
It seems so. |
Please proceed by updating submodule and implementing subtracting instructions. I think the best strategy is to return |
MIPS32 introduces 4 accumulation instructions:
madd
,maddu
,msub
,msubu
. Unlike common instructions, they don't overwrite the contents of HI/LO register pair, but accumulate results:The roadmap for implementation:
The text was updated successfully, but these errors were encountered: