From 4321a689a5eb7159dfbc7c572c2f93998cf90784 Mon Sep 17 00:00:00 2001 From: kub Date: Sat, 25 Apr 2020 21:51:47 +0200 Subject: [PATCH] sh2: bugfix in drc --- cpu/sh2/compiler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/sh2/compiler.c b/cpu/sh2/compiler.c index 04320424..ad1983bf 100644 --- a/cpu/sh2/compiler.c +++ b/cpu/sh2/compiler.c @@ -160,7 +160,7 @@ enum op_types { & BITMASK1(op)) #define OP_ISBRAUC(op) (BITMASK4(OP_BRANCH, OP_BRANCH_R, OP_BRANCH_RF, OP_RTE) \ & BITMASK1(op)) -#define OP_ISBRACND(op) (BITMASK3(OP_BRANCH_CT, OP_BRANCH_CF, OP_BRANCH_N) \ +#define OP_ISBRACND(op) (BITMASK2(OP_BRANCH_CT, OP_BRANCH_CF) \ & BITMASK1(op)) #define OP_ISBRAIMM(op) (BITMASK3(OP_BRANCH, OP_BRANCH_CT, OP_BRANCH_CF) \ & BITMASK1(op)) @@ -3501,7 +3501,7 @@ static void REGPARM(2) *sh2_translate(SH2 *sh2, int tcache_id) rcache_set_usage_now(opd[0].source); // current insn rcache_set_usage_soon(soon); // insns 1-4 rcache_set_usage_late(late & ~soon); // insns 5-9 - rcache_set_usage_discard(write & ~(late|soon)); + rcache_set_usage_discard(write & ~(late|soon|opd[0].source)); if (v <= 9) // upcoming rcache_flush, start writing back unused dirty stuff rcache_clean_masked(rcache_dirty_mask() & ~(write|opd[0].dest)); -- 2.39.5