Received: from eggs.gnu.org ([2001:4830:134:3::10]:49205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1CVD-0008ML-MQ for qemu-devel@nongnu.org; Mon, 31 Oct 2016 09:19:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1CV8-0006hV-Ox for qemu-devel@nongnu.org; Mon, 31 Oct 2016 09:19:51 -0400 Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]:36697) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c1CV8-0006hL-JT for qemu-devel@nongnu.org; Mon, 31 Oct 2016 09:19:46 -0400 Received: by mail-oi0-x233.google.com with SMTP id v84so68948273oie.3 for ; Mon, 31 Oct 2016 06:19:46 -0700 (PDT) Sender: Richard Henderson References: <1477909259-12284-1-git-send-email-laurent@vivier.eu> <1477909259-12284-3-git-send-email-laurent@vivier.eu> From: Richard Henderson Message-ID: Date: Mon, 31 Oct 2016 06:19:43 -0700 MIME-Version: 1.0 In-Reply-To: <1477909259-12284-3-git-send-email-laurent@vivier.eu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 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 10/31/2016 03:20 AM, Laurent Vivier wrote: > + uint16_t mask2 = mask; > + TCGv r[16]; > + for (i = 0; i < 16; i++, mask >>= 1) { > + if (mask & 1) { > + r[i] = gen_load(s, opsize, addr, 1); > + tcg_gen_add_i32(addr, addr, incr); > + } > + } > + for (i = 0; i < 16; i++, mask2 >>= 1) { > + if (mask2 & 1) { > + tcg_gen_mov_i32(mreg(i), r[i]); > + tcg_temp_free(r[i]); > + } > + } While it's not wrong, why not examine mask non-destructively. if ((mask >> i) & 1) r~