From patchwork Wed Oct 21 10:17:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juha.Riihimaki@nokia.com X-Patchwork-Id: 36519 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 2247EB7B78 for ; Wed, 21 Oct 2009 21:26:46 +1100 (EST) Received: from localhost ([127.0.0.1]:33112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0YOw-0000wQ-Bx for incoming@patchwork.ozlabs.org; Wed, 21 Oct 2009 06:26:42 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0YGW-0006JI-SU for qemu-devel@nongnu.org; Wed, 21 Oct 2009 06:18:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0YGS-0006Gn-28 for qemu-devel@nongnu.org; Wed, 21 Oct 2009 06:18:00 -0400 Received: from [199.232.76.173] (port=43276 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0YGR-0006GY-Ll for qemu-devel@nongnu.org; Wed, 21 Oct 2009 06:17:55 -0400 Received: from smtp.nokia.com ([192.100.122.233]:27333 helo=mgw-mx06.nokia.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N0YGQ-0000Vc-0E for qemu-devel@nongnu.org; Wed, 21 Oct 2009 06:17:54 -0400 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9LAHjbY013269 for ; Wed, 21 Oct 2009 13:17:50 +0300 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 21 Oct 2009 13:17:45 +0300 Received: from smtp.mgd.nokia.com ([65.54.30.7]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 21 Oct 2009 13:17:45 +0300 Received: from NOK-EUMSG-05.mgdnok.nokia.com ([65.54.30.90]) by nok-am1mhub-03.mgdnok.nokia.com ([65.54.30.7]) with mapi; Wed, 21 Oct 2009 12:17:43 +0200 From: To: Date: Wed, 21 Oct 2009 12:17:58 +0200 Thread-Topic: [PATCH 07/12] target-arm: fix neon vsri, vshl and vsli ops Thread-Index: AcpSN7ofOisnXSCJQfWRUKqVcCYm4w== Message-ID: Accept-Language: en, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en, en-US MIME-Version: 1.0 X-OriginalArrivalTime: 21 Oct 2009 10:17:45.0090 (UTC) FILETIME=[BB33E620:01CA5237] X-Nokia-AV: Clean X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) Subject: [Qemu-devel] [PATCH 07/12] target-arm: fix neon vsri, vshl and vsli ops 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 Shift immediate value is incorrectly overwritten by a temporary variable in the processing of NEON vsri, vshl and vsli instructions. Signed-off-by: Juha Riihimäki --- TCGv tmp3; @@ -4624,31 +4624,31 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) switch (size) { case 0: if (op == 4) - imm = 0xff >> -shift; + imm2 = 0xff >> -shift; else - imm = (uint8_t)(0xff << shift); - imm |= imm << 8; - imm |= imm << 16; + imm2 = (uint8_t)(0xff << shift); + imm2 |= imm2 << 8; + imm2 |= imm2 << 16; break; case 1: if (op == 4) - imm = 0xffff >> -shift; + imm2 = 0xffff >> -shift; else - imm = (uint16_t)(0xffff << shift); - imm |= imm << 16; + imm2 = (uint16_t)(0xffff << shift); + imm2 |= imm2 << 16; break; case 2: if (op == 4) - imm = 0xffffffffu >> -shift; + imm2 = 0xffffffffu >> -shift; else - imm = 0xffffffffu << shift; + imm2 = 0xffffffffu << shift; break; default: abort(); } tmp2 = neon_load_reg(rd, pass); - tcg_gen_andi_i32(tmp, tmp, imm); - tcg_gen_andi_i32(tmp2, tmp2, ~imm); + tcg_gen_andi_i32(tmp, tmp, imm2); + tcg_gen_andi_i32(tmp2, tmp2, ~imm2); tcg_gen_or_i32(tmp, tmp, tmp2); dead_tmp(tmp2); } diff --git a/target-arm/translate.c b/target-arm/translate.c index 59bf7bc..c92ecc6 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -4094,7 +4094,7 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) int pairwise; int u; int n; - uint32_t imm; + uint32_t imm, imm2; TCGv tmp; TCGv tmp2;