From patchwork Sat Jan 8 16:01:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 77962 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C7E83B70D6 for ; Sun, 9 Jan 2011 03:02:47 +1100 (EST) Received: from localhost ([127.0.0.1]:42970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbbFd-0001bU-3v for incoming@patchwork.ozlabs.org; Sat, 08 Jan 2011 11:02:45 -0500 Received: from [140.186.70.92] (port=38671 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbbET-0001Sh-As for qemu-devel@nongnu.org; Sat, 08 Jan 2011 11:01:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbbEL-0006Ew-07 for qemu-devel@nongnu.org; Sat, 08 Jan 2011 11:01:33 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:5842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbbEK-0006E3-Mk for qemu-devel@nongnu.org; Sat, 08 Jan 2011 11:01:24 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.69) (envelope-from ) id 1PbbEC-0008TJ-LB for qemu-devel@nongnu.org; Sat, 08 Jan 2011 16:01:16 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Sat, 8 Jan 2011 16:01:16 +0000 Message-Id: <1294502476-32537-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1294502476-32537-1-git-send-email-peter.maydell@linaro.org> References: <1294502476-32537-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH v2 2/2] ARM: Fix decoding of VQSHL/VQSHLU immediate forms X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Fix errors in the decoding of ARM VQSHL/VQSHLU immediate forms, including using the new VQSHLU helper functions where appropriate. Reviewed-by: Aurelien Jarno Signed-off-by: Peter Maydell --- target-arm/translate.c | 51 +++++++++++++++++++++++++++++++++-------------- 1 files changed, 36 insertions(+), 15 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index 2ce82f3..57664bc 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -4652,14 +4652,22 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) case 5: /* VSHL, VSLI */ gen_helper_neon_shl_u64(cpu_V0, cpu_V0, cpu_V1); break; - case 6: /* VQSHL */ - if (u) - gen_helper_neon_qshl_u64(cpu_V0, cpu_env, cpu_V0, cpu_V1); - else - gen_helper_neon_qshl_s64(cpu_V0, cpu_env, cpu_V0, cpu_V1); + case 6: /* VQSHLU */ + if (u) { + gen_helper_neon_qshlu_s64(cpu_V0, cpu_env, + cpu_V0, cpu_V1); + } else { + return 1; + } break; - case 7: /* VQSHLU */ - gen_helper_neon_qshl_u64(cpu_V0, cpu_env, cpu_V0, cpu_V1); + case 7: /* VQSHL */ + if (u) { + gen_helper_neon_qshl_u64(cpu_V0, cpu_env, + cpu_V0, cpu_V1); + } else { + gen_helper_neon_qshl_s64(cpu_V0, cpu_env, + cpu_V0, cpu_V1); + } break; } if (op == 1 || op == 3) { @@ -4698,17 +4706,30 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) default: return 1; } break; - case 6: /* VQSHL */ - GEN_NEON_INTEGER_OP_ENV(qshl); - break; - case 7: /* VQSHLU */ + case 6: /* VQSHLU */ + if (!u) { + return 1; + } switch (size) { - case 0: gen_helper_neon_qshl_u8(tmp, cpu_env, tmp, tmp2); break; - case 1: gen_helper_neon_qshl_u16(tmp, cpu_env, tmp, tmp2); break; - case 2: gen_helper_neon_qshl_u32(tmp, cpu_env, tmp, tmp2); break; - default: return 1; + case 0: + gen_helper_neon_qshlu_s8(tmp, cpu_env, + tmp, tmp2); + break; + case 1: + gen_helper_neon_qshlu_s16(tmp, cpu_env, + tmp, tmp2); + break; + case 2: + gen_helper_neon_qshlu_s32(tmp, cpu_env, + tmp, tmp2); + break; + default: + return 1; } break; + case 7: /* VQSHL */ + GEN_NEON_INTEGER_OP_ENV(qshl); + break; } dead_tmp(tmp2);