From patchwork Thu Apr 14 09:29:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 8833031 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 558EBC0553 for ; Thu, 14 Apr 2016 09:29:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6A7E20295 for ; Thu, 14 Apr 2016 09:29:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 08C8920145 for ; Thu, 14 Apr 2016 09:29:40 +0000 (UTC) Received: from localhost ([::1]:35728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqdal-00009F-E7 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 14 Apr 2016 05:29:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqdac-0008RA-UH for qemu-devel@nongnu.org; Thu, 14 Apr 2016 05:29:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqdaa-0007z8-9o for qemu-devel@nongnu.org; Thu, 14 Apr 2016 05:29:30 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:34513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqdaa-0007yy-2n for qemu-devel@nongnu.org; Thu, 14 Apr 2016 05:29:28 -0400 Received: by mail-wm0-x243.google.com with SMTP id n3so21100503wmn.1 for ; Thu, 14 Apr 2016 02:29:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=m06WBJw6U5e/467IzRYLx1LeV5gZMj7i2LrJ0fCDQfw=; b=FseJPrEmyir71+i8VijyskfXISEc9fFVowU++1eyWlvdrlfKznsn+IeH+wgMnesM61 Bu0By7LN6ytVtk/uDupzOUhvEPxw7PxT+V9UYfQCl6gMd7QMI2LW7gQjVDu37U/6Btau CPxRP2EWThNUrcj827zv7sVb3c9Oe62D4BaouIWbaabqTarPHUqPu4BN6sVGvaGj7yUE VyH/LYVozNvC5nhNKuyxDD2agUrtKJuIrcQN31su6HBg/iESDAMli8b9aI96VxxFRtOD OPVdVcn4eaJFx2lV4iez3PPJOvxadKjVsg3phBHRmL7o8g316j7inIJrktxY7qAzmbud P6pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=m06WBJw6U5e/467IzRYLx1LeV5gZMj7i2LrJ0fCDQfw=; b=BrNhY2Im/HGa9vYk5GXiRi4NWxdtJ7nnkY33TNVgpk4xqwFkjQEzRpwYiIViAC27Kw zB2sJzekQVYlQBZ2t6qxQYBqt8NgrGO3rIYpSDjBKGhPIlR8ZtBLCFmZjn5Z3h/qQaBX CNF61F9cVt3/fUHvbKKrpbjVmK/P3lHfb0+6b07GyKBL3G3dGtT94Fl8TORAQXG12GLg rQ6bas8/FCAIoKmTpr+bHZgV+KHNiQ5/B+p4VNyqagIhWWXgbu+2bG0AndzbtdhPEoEj LhytZ83zuHYC0zprZmvQa777oeI6Lbtcs6ZspukrwMlm5BSEj7/r0RIoav1mo8O1L7lW p3MQ== X-Gm-Message-State: AOPr4FXmNhYTkkD/SvtpipMH7qncEQGalefTgWBKtj/vHve/ly5a5HRHvZDAZCOdeD3cnA== X-Received: by 10.194.88.201 with SMTP id bi9mr11759667wjb.147.1460626167144; Thu, 14 Apr 2016 02:29:27 -0700 (PDT) Received: from localhost (x55b5cb60.dyn.telefonica.de. [85.181.203.96]) by smtp.gmail.com with ESMTPSA id a16sm32518231wme.22.2016.04.14.02.29.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Apr 2016 02:29:26 -0700 (PDT) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Thu, 14 Apr 2016 11:29:15 +0200 Message-Id: X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH 1/2 for-2.6] target-sparc: fix Nucleus quad LDD 128 bit access for windowed registers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.cave-ayland@ilande.co.uk, Artyom Tarasenko , rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix register offset calculation when regwptr is used. Signed-off-by: Artyom Tarasenko --- target-sparc/ldst_helper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c index 2b0221c..a383074 100644 --- a/target-sparc/ldst_helper.c +++ b/target-sparc/ldst_helper.c @@ -2059,11 +2059,11 @@ void helper_ldda_asi(CPUSPARCState *env, target_ulong addr, int asi, int rd) bswap64s(&env->gregs[rd + 1]); } } else { - env->regwptr[rd] = cpu_ldq_nucleus(env, addr); - env->regwptr[rd + 1] = cpu_ldq_nucleus(env, addr + 8); + env->regwptr[rd - 8] = cpu_ldq_nucleus(env, addr); + env->regwptr[rd + 1 - 8] = cpu_ldq_nucleus(env, addr + 8); if (asi == 0x2c) { - bswap64s(&env->regwptr[rd]); - bswap64s(&env->regwptr[rd + 1]); + bswap64s(&env->regwptr[rd - 8]); + bswap64s(&env->regwptr[rd + 1 - 8]); } } break; @@ -2076,8 +2076,8 @@ void helper_ldda_asi(CPUSPARCState *env, target_ulong addr, int asi, int rd) env->gregs[rd] = helper_ld_asi(env, addr, asi, 4, 0); env->gregs[rd + 1] = helper_ld_asi(env, addr + 4, asi, 4, 0); } else { - env->regwptr[rd] = helper_ld_asi(env, addr, asi, 4, 0); - env->regwptr[rd + 1] = helper_ld_asi(env, addr + 4, asi, 4, 0); + env->regwptr[rd - 8] = helper_ld_asi(env, addr, asi, 4, 0); + env->regwptr[rd + 1 - 8] = helper_ld_asi(env, addr + 4, asi, 4, 0); } break; }