From patchwork Fri Oct 30 02:26:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 319982 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1014194ilc; Thu, 29 Oct 2020 19:28:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJEnMAcOGpjfNCNapZEYAOVNGpp0sBZMI+ztKr/PUOqpAZftksELI/zTjJUUFC4RlOqhXq X-Received: by 2002:a25:cc8e:: with SMTP id l136mr587830ybf.10.1604024934489; Thu, 29 Oct 2020 19:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604024934; cv=none; d=google.com; s=arc-20160816; b=Q9P9CBdubd5MZBbwwujeaQIBfxAyoqiS6NPPDK3c7HdaXJfgOl3v0izYW6+1HIJyfv 3sYwCRAZpLhMN0s2/z76Dh/xwpZaz8gtzeyTp3rf8dAe8/zyP3AWXWeOlbuWtiVtZaqo 4WHCGA6cxy/zLLZgAAc0phqwmOjLlDzDec+OI3evrAkRguel0jNStbzaKClCMQhkJpRv A0N9AkdYaNEr1Zw/RLD2zoArUO7dL/ngtYj72H40PS0c9HhktG59qlaQUPLtdkWrN5RN XfDH/0AFTvUWpdMN+wd46zF7nuRpiaOs38fYXmjz171dORM9yp/DokDg3pxCiWC917o2 Jj4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=d+BfMFnltv94D9h3YrYpUyscB1U2BxczjPk7SPCCLHg=; b=Q6Rnr7hBco/aDTtS6GcbsdsUsZdnWgG8szOzm+C/IeeIce0FPgCV140k6mAZDFFq3d twMkkn6K7uV0cGoS1ZQSjPBIoAAXDi0lHjDfHC2U5vFlHv+fQ68DK4Rux2obMpSxBzjl OdtcS8HGm9Skx99/554z6Do+1+dgr1fg7qPR28yMwzJ0aDKwdCrwNDQBTkZ2TAxHdiiD 863oihCuxXKjfUba++hGtAs7fT0WfI41HYz2rRugIz+NZZuO04b8/4C/SwuwVf05a4bi fgfCGRtqpl4DCYvAE0q1v9ZK0MS9p/XHwee0u5kz/6Ma5bI9QZc4NBFaDLgbEMEDWdCl Q/iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WmXeekiO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w8si5010576ybs.13.2020.10.29.19.28.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Oct 2020 19:28:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WmXeekiO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYK9t-0007rJ-TL for patch@linaro.org; Thu, 29 Oct 2020 22:28:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYK7W-0004yw-Kg for qemu-devel@nongnu.org; Thu, 29 Oct 2020 22:26:26 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:42755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYK7U-0005uL-GK for qemu-devel@nongnu.org; Thu, 29 Oct 2020 22:26:26 -0400 Received: by mail-pg1-x52f.google.com with SMTP id k9so2224676pgt.9 for ; Thu, 29 Oct 2020 19:26:24 -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 :mime-version:content-transfer-encoding; bh=d+BfMFnltv94D9h3YrYpUyscB1U2BxczjPk7SPCCLHg=; b=WmXeekiOayWAzZXmzjasX34a63S1llh07JYPPRrtY2FQvl40jDxg0TS4XjjGYVOFFE HiuMJWbhaRZeeh6KhgRDy1/zg6Qo5xDAvhKnxMce8wh6GmzLAIJ+H4Egn4NsbVOHrhrm p6OABvxb/wQVPAwK0Q2bUL8kTuQZwufwxFzUkt2rUQz3EtMzqE1bRoCRv9orEaFWfalD qiG0AUhiVwg8E/K3+WvXW28UrYZIbY9qjfANO+3dnszuyRucG5Eaz0ffYnj2slFzlCji yIzE+4Mapd4eZKy6tA7xGVFoXxOHtiVabYE3aavAVbJzHJ0gRH3shdAFaDBTVulqbXBI qAhg== 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:mime-version:content-transfer-encoding; bh=d+BfMFnltv94D9h3YrYpUyscB1U2BxczjPk7SPCCLHg=; b=fKhajSbE4G8i0tbeNQrjdnczX8xKW96RYW81sJpXFem37sNtdLjEkMEZUikEkhCITa UUKX9g70xmMcZKjkg8a4r5dJ06ij5hCKk6YyvWnbOlKkowS7exRe86vzVwuA0+UGPDcq Ln9FD7uykq8AUkIVZVPIlNTnUDqeLuJuSRzOFN45tCianNdnnOSgzWJQLXI1LrzJ0zgj 3boqRkt7MwvOg3ilvTfrn5RfeMNHL6hRm2u96ad0oF42CbnwheNTiJ9fDINLtWKBsQQf NhzfgAqxVAv1Zv9+DgTwRyYZrnjGmmfg3Li5B/0nXAcnOAkorIesFtA832iPe7Sh5BLU 0/ew== X-Gm-Message-State: AOAM532M5Af1kRMecq/B4BY7JtO1gcULeodoNfqYA1pNGf+mLKDYchnz 946oCkVeXVstSz6K9+xoJ77zlacLiK+D1Q== X-Received: by 2002:a17:90a:3e09:: with SMTP id j9mr116490pjc.192.1604024782736; Thu, 29 Oct 2020 19:26:22 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id b7sm4446517pfr.171.2020.10.29.19.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 19:26:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 02/11] target/arm: Move neon_element_offset to translate.c Date: Thu, 29 Oct 2020 19:26:09 -0700 Message-Id: <20201030022618.785675-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030022618.785675-1-richard.henderson@linaro.org> References: <20201030022618.785675-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This will shortly have users outside of translate-neon.c.inc. Signed-off-by: Richard Henderson --- target/arm/translate.c | 20 ++++++++++++++++++++ target/arm/translate-neon.c.inc | 19 ------------------- 2 files changed, 20 insertions(+), 19 deletions(-) -- 2.25.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index 1b61e50f9c..bf0b5cac61 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -1102,6 +1102,26 @@ static long neon_full_reg_offset(unsigned reg) return offsetof(CPUARMState, vfp.zregs[reg >> 1].d[reg & 1]); } +/* + * Return the offset of a 2**SIZE piece of a NEON register, at index ELE, + * where 0 is the least significant end of the register. + */ +static long neon_element_offset(int reg, int element, MemOp size) +{ + int element_size = 1 << size; + int ofs = element * element_size; +#ifdef HOST_WORDS_BIGENDIAN + /* + * Calculate the offset assuming fully little-endian, + * then XOR to account for the order of the 8-byte units. + */ + if (element_size < 8) { + ofs ^= 8 - element_size; + } +#endif + return neon_full_reg_offset(reg) + ofs; +} + static inline long vfp_reg_offset(bool dp, unsigned reg) { if (dp) { diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.inc index e259e24c05..96ab2248fc 100644 --- a/target/arm/translate-neon.c.inc +++ b/target/arm/translate-neon.c.inc @@ -60,25 +60,6 @@ static inline int neon_3same_fp_size(DisasContext *s, int x) #include "decode-neon-ls.c.inc" #include "decode-neon-shared.c.inc" -/* Return the offset of a 2**SIZE piece of a NEON register, at index ELE, - * where 0 is the least significant end of the register. - */ -static inline long -neon_element_offset(int reg, int element, MemOp size) -{ - int element_size = 1 << size; - int ofs = element * element_size; -#ifdef HOST_WORDS_BIGENDIAN - /* Calculate the offset assuming fully little-endian, - * then XOR to account for the order of the 8-byte units. - */ - if (element_size < 8) { - ofs ^= 8 - element_size; - } -#endif - return neon_full_reg_offset(reg) + ofs; -} - static void neon_load_element(TCGv_i32 var, int reg, int ele, MemOp mop) { long offset = neon_element_offset(reg, ele, mop & MO_SIZE);