From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtn3y-0000Ig-Qj for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:50:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qtn3e-0006sm-1w for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:49:59 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:54665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtn3d-0006nC-V1 for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:49:50 -0400 Received: by mail-gx0-f173.google.com with SMTP id 26so1231167gxk.4 for ; Wed, 17 Aug 2011 13:49:44 -0700 (PDT) From: Bryce Lanham Date: Wed, 17 Aug 2011 15:46:58 -0500 Message-Id: <1313614076-28878-54-git-send-email-blanham@gmail.com> In-Reply-To: <1313614076-28878-1-git-send-email-blanham@gmail.com> References: <1313614076-28878-1-git-send-email-blanham@gmail.com> Subject: [Qemu-devel] [PATCH 053/111] m68k: for bitfield opcodes, correct operands corruption List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laurent Vivier From: Laurent Vivier This patch doesn't modify values inside operand "shift" and "offset", instead copy them in a TCG temp. Signed-off-by: Laurent Vivier --- target-m68k/translate.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 4f2a5ee..e0c6fa3 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -2693,7 +2693,8 @@ static void bitfield_param(uint16_t ext, TCGv *offset, TCGv *width, TCGv *mask) /* offset */ if (ext & 0x0800) { - *offset = DREG(ext, 6); + *offset = tcg_temp_new_i32(); + tcg_gen_mov_i32(*offset, DREG(ext, 6)); } else { *offset = tcg_temp_new_i32(); tcg_gen_movi_i32(*offset, (ext >> 6) & 31); @@ -2702,8 +2703,8 @@ static void bitfield_param(uint16_t ext, TCGv *offset, TCGv *width, TCGv *mask) /* width */ if (ext & 0x0020) { - *width = DREG(ext, 0); - tcg_gen_subi_i32(*width, *width, 1); + *width = tcg_temp_new_i32(); + tcg_gen_subi_i32(*width, DREG(ext, 0), 1); tcg_gen_andi_i32(*width, *width, 31); tcg_gen_addi_i32(*width, *width, 1); } else { -- 1.7.2.3