Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fixed carry flag calculation in negc op
added more tests for negc sanitize bits stored in SR just as they are in FPSCR removed unneeded disp_pc struct in sh4_instr union emits calls to invalid_instr callback for INVALID ops
- Loading branch information
Showing
with
114 additions
and 39 deletions.
- +12 −4 src/hw/sh4/sh4_intc.c
- +11 −0 src/jit/frontend/sh4/sh4_context.h
- +0 −6 src/jit/frontend/sh4/sh4_disasm.h
- +6 −4 src/jit/frontend/sh4/sh4_fallback.c
- +11 −10 src/jit/frontend/sh4/sh4_instr.h
- +14 −7 src/jit/frontend/sh4/sh4_translate.c
- +54 −6 test/asm/negc.s
- +6 −2 test/test_sh4.inc
@@ -1,17 +1,65 @@ | ||
test_negc_nocarry: | ||
test_negc_zero_nocarry: | ||
# REGISTER_IN r0 0x700000f0 | ||
# REGISTER_IN r1 -4 | ||
# REGISTER_IN r1 0x0 | ||
ldc r0, SR | ||
negc r1, r2 | ||
stc SR, r0 | ||
rts | ||
nop | ||
# REGISTER_OUT r2 4 | ||
# REGISTER_OUT r0 0x700000f0 | ||
# REGISTER_OUT r2 0x0 | ||
|
||
test_negc_carry: | ||
test_negc_zero_carry: | ||
# REGISTER_IN r0 0x700000f1 | ||
# REGISTER_IN r1 -4 | ||
# REGISTER_IN r1 0x0 | ||
ldc r0, SR | ||
negc r1, r2 | ||
stc SR, r0 | ||
rts | ||
nop | ||
# REGISTER_OUT r2 3 | ||
# REGISTER_OUT r0 0x700000f1 | ||
# REGISTER_OUT r2 0xffffffff | ||
|
||
test_negc_neg_nocarry: | ||
# REGISTER_IN r0 0x700000f0 | ||
# REGISTER_IN r1 0x80000000 | ||
ldc r0, SR | ||
negc r1, r2 | ||
stc SR, r0 | ||
rts | ||
nop | ||
# REGISTER_OUT r0 0x700000f1 | ||
# REGISTER_OUT r2 0x80000000 | ||
|
||
test_negc_neg_carry: | ||
# REGISTER_IN r0 0x700000f1 | ||
# REGISTER_IN r1 0x80000000 | ||
ldc r0, SR | ||
negc r1, r2 | ||
stc SR, r0 | ||
rts | ||
nop | ||
# REGISTER_OUT r0 0x700000f1 | ||
# REGISTER_OUT r2 0x7fffffff | ||
|
||
test_negc_pos_nocarry: | ||
# REGISTER_IN r0 0x700000f0 | ||
# REGISTER_IN r1 0x7fffffff | ||
ldc r0, SR | ||
negc r1, r2 | ||
stc SR, r0 | ||
rts | ||
nop | ||
# REGISTER_OUT r0 0x700000f1 | ||
# REGISTER_OUT r2 0x80000001 | ||
|
||
test_negc_pos_carry: | ||
# REGISTER_IN r0 0x700000f1 | ||
# REGISTER_IN r1 0x7fffffff | ||
ldc r0, SR | ||
negc r1, r2 | ||
stc SR, r0 | ||
rts | ||
nop | ||
# REGISTER_OUT r0 0x700000f1 | ||
# REGISTER_OUT r2 0x80000000 |
Oops, something went wrong.