From nobody Sat Nov 1 07:53:06 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1526511518015475.77232421603276; Wed, 16 May 2018 15:58:38 -0700 (PDT) Received: from localhost ([::1]:45925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ5NV-00056E-Bg for importer@patchew.org; Wed, 16 May 2018 18:58:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ4wc-00082n-FJ for qemu-devel@nongnu.org; Wed, 16 May 2018 18:30:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJ4wa-0007nw-DB for qemu-devel@nongnu.org; Wed, 16 May 2018 18:30:50 -0400 Received: from mail-pl0-x22b.google.com ([2607:f8b0:400e:c01::22b]:36191) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJ4wa-0007na-7G for qemu-devel@nongnu.org; Wed, 16 May 2018 18:30:48 -0400 Received: by mail-pl0-x22b.google.com with SMTP id v24-v6so1253312plo.3 for ; Wed, 16 May 2018 15:30:48 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id j1-v6sm6640418pfc.159.2018.05.16.15.30.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 15:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dg1WBnCOa5f1mNYqPGqrKxWSClxIHHeHmUJedBN44r0=; b=CZIvaRbguCkXUfaByVoEcmgsOJzzWsWv8dGNlEZ6bu/jbtICxcr6ywcwIGkHjvYGIr PCaj2hi8sGpTotOEMqMFa6A55cGIY1wY0rqcehLirfJdPm8llfJKJWwh7X43pXYdMwLP 2iAIPTQO2QPOypKMXLg0sVw1dsyCNweLV685s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dg1WBnCOa5f1mNYqPGqrKxWSClxIHHeHmUJedBN44r0=; b=XE8IZBcaba38PciNzwW3ixR10MnGgGKPCaTVKKp2T49dRa47FyqMI0giNrfa0d5Enq OiQ3T5lmRl8tKf51Axo0c/7drPTbJtb5DpaLOqsV/NFvZabdJIq3iJQFH/MiO0nVklfF sUBQxRSkiSLl8AYJxPWgyYmGVPxpuSqkhuxFn5qUi4OPTwHqyGpanxxDTfOuht2iCcRY 8Q27qCRbwZYRPYpxE/6ykbI8xAvx1jrOww8caHNj7sQJT7VYzyl9CXSbY94aZMKGXmTF HCTZ/VU7rF8fgxG7JdXHa1y7cYzDr5nv5Tok7Gr/iwKHC3MqxS/dzloagBUP0RhCEuff qQRg== X-Gm-Message-State: ALKqPwcEOi7jhXX0gZfBH8hmkrvTL2t8Y/BNakS2U8noaq1tR0kYcjv1 4jIZ0nfCHLqQfy922fuQgJCKKNM05SI= X-Google-Smtp-Source: AB8JxZowraG2b05PUc2J+JVBx55V0oG1XMRpVNeEXzEcU2ZxkcqVdm1oH7TZ1uifUEQWXUPjWVQQNA== X-Received: by 2002:a17:902:c5:: with SMTP id a63-v6mr2702580pla.149.1526509846994; Wed, 16 May 2018 15:30:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 16 May 2018 15:30:06 -0700 Message-Id: <20180516223007.10256-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516223007.10256-1-richard.henderson@linaro.org> References: <20180516223007.10256-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::22b Subject: [Qemu-devel] [PATCH v3-a 26/27] target/arm: Extend vec_reg_offset to larger sizes 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: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Rearrange the arithmetic so that we are agnostic about the total size of the vector and the size of the element. This will allow us to index up to the 32nd byte and with 16-byte elements. Signed-off-by: Richard Henderson --- target/arm/translate-a64.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h index dd9c09f89b..5a97ae2b59 100644 --- a/target/arm/translate-a64.h +++ b/target/arm/translate-a64.h @@ -67,18 +67,18 @@ static inline void assert_fp_access_checked(DisasContex= t *s) static inline int vec_reg_offset(DisasContext *s, int regno, int element, TCGMemOp size) { - int offs =3D 0; + int element_size =3D 1 << size; + int offs =3D element * element_size; #ifdef HOST_WORDS_BIGENDIAN /* This is complicated slightly because vfp.zregs[n].d[0] is * still the low half and vfp.zregs[n].d[1] the high half * of the 128 bit vector, even on big endian systems. - * Calculate the offset assuming a fully bigendian 128 bits, - * then XOR to account for the order of the two 64 bit halves. + * Calculate the offset assuming a fully little-endian 128 bits, + * then XOR to account for the order of the 64 bit units. */ - offs +=3D (16 - ((element + 1) * (1 << size))); - offs ^=3D 8; -#else - offs +=3D element * (1 << size); + if (element_size < 8) { + offs ^=3D 8 - element_size; + } #endif offs +=3D offsetof(CPUARMState, vfp.zregs[regno]); assert_fp_access_checked(s); --=20 2.17.0