From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayjoQ-0001q1-BL for qemu-devel@nongnu.org; Fri, 06 May 2016 13:45:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayjoE-0003uq-Em for qemu-devel@nongnu.org; Fri, 06 May 2016 13:45:08 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:52637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayjoE-0003sc-8n for qemu-devel@nongnu.org; Fri, 06 May 2016 13:45:02 -0400 From: Andreas Schwab References: <1462392752-17703-1-git-send-email-laurent@vivier.eu> <1462392752-17703-31-git-send-email-laurent@vivier.eu> <697948ca-31cd-bfb5-2eed-a607124516d1@twiddle.net> Date: Fri, 06 May 2016 19:44:50 +0200 In-Reply-To: <697948ca-31cd-bfb5-2eed-a607124516d1@twiddle.net> (Richard Henderson's message of "Fri, 6 May 2016 07:18:04 -1000") Message-ID: <87h9ebxer1.fsf@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 30/52] target-m68k: add scc/dbcc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Laurent Vivier , qemu-devel@nongnu.org, gerg@uclinux.org, agraf@suse.de Richard Henderson writes: > On 05/04/2016 10:12 AM, Laurent Vivier wrote: >> + DEST_EA(env, insn, OS_BYTE, dest, NULL); >> + tcg_temp_free(dest); >> +} >> + >> +DISAS_INSN(dbcc) >> +{ >> + TCGLabel *l1; >> + TCGv reg; >> + TCGv tmp; >> + int16_t offset; >> + uint32_t base; >> + >> + reg = DREG(insn, 0); >> + base = s->pc; >> + offset = (int16_t)read_im16(env, s); >> + l1 = gen_new_label(); >> + gen_jmpcc(s, (insn >> 8) & 0xf, l1); >> + >> + tmp = tcg_temp_new(); >> + tcg_gen_ext16s_i32(tmp, reg); >> + tcg_gen_addi_i32(tmp, tmp, -1); >> + gen_partset_reg(OS_WORD, reg, tmp); >> + tcg_gen_brcondi_i32(TCG_COND_EQ, tmp, -1, l1); >> + update_cc_op(s); >> + gen_jmp_tb(s, 1, base + offset); >> + gen_set_label(l1); >> + update_cc_op(s); >> + gen_jmp_tb(s, 0, s->pc); > > Pull the update_cc_op up to the top, so as to only generate one copy. This misses a followup patch which moves it into gen_jmpcc. In the current form this would result in a mistranslation. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."