From 076d85eaeeeb5ca37cfa6836cb8dd3c5368cf424 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Sun, 24 Feb 2019 23:48:08 +0100 Subject: Correct relative jumps range and adjust it for single core without delay-slot. Setting bits 16 to 31 to 1 is incorrect, offset is shift by two so bit 16 can be zero for jumps in range -64k to -128k. Adjust relative offsets to compute target address same, as if there is delay slot, for CPU variant without delay slot. This allows to use same/standard MIPS assembler for mode without delay slots. Signed-off-by: Pavel Pisa --- qtmips_machine/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qtmips_machine/core.h') diff --git a/qtmips_machine/core.h b/qtmips_machine/core.h index f70a19d..1c44550 100644 --- a/qtmips_machine/core.h +++ b/qtmips_machine/core.h @@ -245,7 +245,7 @@ protected: struct dtExecute execute(const struct dtDecode&); struct dtMemory memory(const struct dtExecute&); void writeback(const struct dtMemory&); - bool handle_pc(const struct dtDecode&); + bool handle_pc(const struct dtDecode&, std::int32_t rel_adj = 0); enum ExceptionCause memory_special(enum AccessControl memctl, int mode, bool memread, bool memwrite, -- cgit v1.2.3