From 75aba9cc656ba7ae26df5c09e7ef46f209dcbda0 Mon Sep 17 00:00:00 2001 From: kub Date: Fri, 16 Apr 2021 00:18:58 +0200 Subject: [PATCH] sh2 drc, tiny optimization for x86 --- cpu/sh2/compiler.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/sh2/compiler.c b/cpu/sh2/compiler.c index 8a46f431..1adfe838 100644 --- a/cpu/sh2/compiler.c +++ b/cpu/sh2/compiler.c @@ -2661,6 +2661,10 @@ static int emit_get_rbase_and_offs(SH2 *sh2, sh2_reg_e r, int rmode, s32 *offs) } else { // known fixed host address la = split_address(la + ((a + *offs) & mask), omask, offs); + if (la == 0) { + la = *offs; + *offs = 0; + } hr = rcache_get_tmp(); emith_move_r_ptr_imm(hr, la); } -- 2.39.2