From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2daW-000684-M5 for qemu-devel@nongnu.org; Fri, 04 Nov 2016 08:27:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2daR-0002If-Ow for qemu-devel@nongnu.org; Fri, 04 Nov 2016 08:27:16 -0400 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:36560) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2daR-0002Hh-Gn for qemu-devel@nongnu.org; Fri, 04 Nov 2016 08:27:11 -0400 Received: by mail-oi0-x243.google.com with SMTP id 128so12307086oih.3 for ; Fri, 04 Nov 2016 05:27:11 -0700 (PDT) Sender: Richard Henderson References: <1478121319-31986-1-git-send-email-laurent@vivier.eu> <1478121319-31986-3-git-send-email-laurent@vivier.eu> <900365e4-40de-5690-44c6-1bf0a07919a1@twiddle.net> <2af3d3a3-2405-ad45-a136-376e6ade53ac@vivier.eu> From: Richard Henderson Message-ID: <0f2bf02b-8656-af69-42a0-2aab452c4cbb@twiddle.net> Date: Fri, 4 Nov 2016 06:27:07 -0600 MIME-Version: 1.0 In-Reply-To: <2af3d3a3-2405-ad45-a136-376e6ade53ac@vivier.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 2/3] target-m68k: implement 680x0 movem List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , qemu-devel@nongnu.org Cc: schwab@linux-m68k.org, agraf@suse.de, gerg@uclinux.org On 11/04/2016 01:59 AM, Laurent Vivier wrote: > Le 03/11/2016 à 21:47, Richard Henderson a écrit : >> On 11/02/2016 03:15 PM, Laurent Vivier wrote: >>> + for (i = 15; i >= 0; i--, mask >>= 1) { >>> + if (mask & 1) { >>> + if ((insn & 7) + 8 == i && >>> + m68k_feature(s->env, M68K_FEATURE_EXT_FULL)) { >>> + /* M68020+: if the addressing register is the >>> + * register moved to memory, the value written >>> + * is the initial value decremented by the >>> size of >>> + * the operation >>> + * M68000/M68010: the value is the initial value >>> + */ >>> + TCGv tmp = tcg_temp_new(); >>> + tcg_gen_sub_i32(tmp, mreg(i), incr); >>> + gen_store(s, opsize, addr, tmp); >>> + tcg_temp_free(tmp); >>> + } else { >>> + gen_store(s, opsize, addr, mreg(i)); >>> + } >>> + if (mask != 1) { >>> + tcg_gen_sub_i32(addr, addr, incr); >>> + } >>> + } >> >> One more thing: This is pre-decrement. Why are you decrementing after >> the store? Seems to me this should be >> >> if (mask & 1) { >> tcg_gen_sub_i32(addr, addr, incr); >> if (REG(insn, 0) + 8 == i ...) >> ... >> } >> > > Because it has already been decremented by gen_lea()... so this a > problem if we have page fault, except if we use your "areg writeback" > series, and we will. Ah, I see. No, gen_lea doesn't writeback; only gen_ea does. But I wonder if this couldn't be cleaned up a tad. I'll get back to you. r~