From patchwork Thu Sep 19 13:10:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 829611 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp317419wrn; Thu, 19 Sep 2024 06:14:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVdWe3nk5IeQi4cYitztdEuNUF3MidpARW6gqoPOU0NvLpJZbczmM1WLRRrp/NqCizU3GiWMw==@linaro.org X-Google-Smtp-Source: AGHT+IHQvl5fOIar1caphSF6PlKOXUFv/jy2rwusvd4XDQbavz/lHtoDy0G/KXauSqkewxOD6lHK X-Received: by 2002:a05:6122:3288:b0:4f5:197a:d679 with SMTP id 71dfb90a1353d-503c9ba3e45mr1863125e0c.1.1726751659035; Thu, 19 Sep 2024 06:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726751659; cv=none; d=google.com; s=arc-20240605; b=gvJAFYs062QQrLdIdy8oC9W6UtDkwlOCT/Vsy5jKA+j3LT7KjZ6IGJSmsldm/oi9dw oTxdHt1fHdwKObeATgtqRBLpfLHL0z3Z97oRsQ/nNzWiVNN0FJXUk8QR9h6xSpw9HPEE fzWN0ROd9mcWIwlqehKA5IOdKCF+b2MP/9N5BOG4XJf235aKEC9gr54voYT7f4BG4EPL KWmuZ0W6e7Xz+0nwGeSvmcfPPyuXGu0GzG2Q+Pw8lER9FPhZv7xSTQN1IBlOaUnRJOaV Q2XacfXhEIbG2JX8K/MsWdgNw8pIsEbuxfixR09qX2Ksq7MaxdqIgCNwK+fopVoJZSu5 cf4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to: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=PwISEcabRGvIN2Ug75sruZUxfeshtkeh7kv+0zeczuo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=K2OC3MW0bhNcSok1ZjZweGpYCdqqK06lXniyvL9gYkwnMb209FvfWyz9sSlS/ouP1B isR95oBLzZHW3f5jWxnkh/htdJDwvz9hgg72DlinEpK6OGGUvJ9+1DMD47dW3+O0IJWj cHFU2hTzlEsDz2yJ2A3pBj2gaYOErhNXm2ISmBbx1vroNo1JEymgcu2RKNR+m2dGg1mb 0ldkwmgPTi5UXG6Mknkqs29Wn926vfdrH75pjeEy+VqttNWgvqR4th+Zu6Y/TYPXvNYn fV3XvNF6PZoFzECZz01Udjjpex/bb66Vw6U3afPf9KgTKeecsqo1WPb4AIriBe1vCjeu LE+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cplLOTvd; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-5035bb52981si2579330e0c.145.2024.09.19.06.14.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Sep 2024 06:14:19 -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=cplLOTvd; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srGwL-0004i7-3I; Thu, 19 Sep 2024 09:11:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srGwE-0004T0-PV for qemu-devel@nongnu.org; Thu, 19 Sep 2024 09:11:14 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1srGwC-00010B-3d for qemu-devel@nongnu.org; Thu, 19 Sep 2024 09:11:14 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42cb9a0c300so7125165e9.0 for ; Thu, 19 Sep 2024 06:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726751470; x=1727356270; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=PwISEcabRGvIN2Ug75sruZUxfeshtkeh7kv+0zeczuo=; b=cplLOTvdKS7F8EPDN089sY8dKjW9FEnj7HFjTWuzuizsiEs2tQd/XP5orltteiuhFd yvM7r4i0GlVsx5P3c2cX9CnZOGrO6Fnh/d0o0pD5VWU+WYj7cmlELI5NADaZDwj6oqdI P+AldwP+zJ/IbhNTwhKb/U7H6uhzUKcOFjRMt23FoQP7QmDkCSWXWBQgNWDYwAVpEd2M AhBRRbKFgJsxcNRqTt+BiWuvKX3q2kOTPZlMo76l7wyRgUMA5YWqqSC2C4yJXV3WuhUk Y9jbXb1qK+6NLiKuqhyyTRqMCIGl+d87HWvuPXuurGQoSv+4kj8SmhmPKxTL3/YPKv5Q C8jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726751470; x=1727356270; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PwISEcabRGvIN2Ug75sruZUxfeshtkeh7kv+0zeczuo=; b=roGpvKXmLdztKv6/eNhrUDK9ZGy9ZGXsZv9HFXHGOJoynjaUbLeQteWufog6ew6j2O XUpnNaOMBcUyoI3E1yeE6pXYexuT0VkrvjvZdcf8xmVdSmtjTgxtqA+joF0vcOJcwKSD 4WoDCip10QHDGAM5/1Gbh/hUfzHAnNhBjKLMo7EAbAfzRcRMhFWg7Bfi9tU8PHX/aHji gkYLXedPHkDr6bTRNvaAo02MUfQOrqzp+ZHIgwrJtInJYcGQkTelf1saDS7AF2iYFqhm s5xhFHWTNcZG2n9nkUuni/YZXY0vZkaE1sLCHBX0/om4qDkm4v61EAIcqY/KeXPlIHdH 747Q== X-Gm-Message-State: AOJu0YzMTqoNGuvmK4TPTIRrsXuBu30vr2d696wUD/VhesYRyhUX8ATB 5alAMBCkYH60y12WRDClg3vtG0QU0sKYCIrKda0ZUF88cK5iMv7jgKu5UVmpfeaCc2RNhDQ4QtL n X-Received: by 2002:a05:600c:470d:b0:42c:bb96:340e with SMTP id 5b1f17b1804b1-42cdb56fa94mr170560335e9.31.1726751470486; Thu, 19 Sep 2024 06:11:10 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e754091d3sm21667845e9.10.2024.09.19.06.11.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 06:11:10 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/38] target/arm: Use tcg_gen_extract2_i64 for EXT Date: Thu, 19 Sep 2024 14:10:33 +0100 Message-Id: <20240919131106.3362543-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240919131106.3362543-1-peter.maydell@linaro.org> References: <20240919131106.3362543-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson The extract2 tcg op performs the same operation as the do_ext64 function. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240912024114.1097832-6-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/translate-a64.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 6d5f12e8f55..1a0b2bb33b6 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8890,23 +8890,6 @@ static void disas_data_proc_fp(DisasContext *s, uint32_t insn) } } -static void do_ext64(DisasContext *s, TCGv_i64 tcg_left, TCGv_i64 tcg_right, - int pos) -{ - /* Extract 64 bits from the middle of two concatenated 64 bit - * vector register slices left:right. The extracted bits start - * at 'pos' bits into the right (least significant) side. - * We return the result in tcg_right, and guarantee not to - * trash tcg_left. - */ - TCGv_i64 tcg_tmp = tcg_temp_new_i64(); - assert(pos > 0 && pos < 64); - - tcg_gen_shri_i64(tcg_right, tcg_right, pos); - tcg_gen_shli_i64(tcg_tmp, tcg_left, 64 - pos); - tcg_gen_or_i64(tcg_right, tcg_right, tcg_tmp); -} - /* EXT * 31 30 29 24 23 22 21 20 16 15 14 11 10 9 5 4 0 * +---+---+-------------+-----+---+------+---+------+---+------+------+ @@ -8944,7 +8927,7 @@ static void disas_simd_ext(DisasContext *s, uint32_t insn) read_vec_element(s, tcg_resl, rn, 0, MO_64); if (pos != 0) { read_vec_element(s, tcg_resh, rm, 0, MO_64); - do_ext64(s, tcg_resh, tcg_resl, pos); + tcg_gen_extract2_i64(tcg_resl, tcg_resl, tcg_resh, pos); } } else { TCGv_i64 tcg_hh; @@ -8965,10 +8948,10 @@ static void disas_simd_ext(DisasContext *s, uint32_t insn) read_vec_element(s, tcg_resh, elt->reg, elt->elt, MO_64); elt++; if (pos != 0) { - do_ext64(s, tcg_resh, tcg_resl, pos); + tcg_gen_extract2_i64(tcg_resl, tcg_resl, tcg_resh, pos); tcg_hh = tcg_temp_new_i64(); read_vec_element(s, tcg_hh, elt->reg, elt->elt, MO_64); - do_ext64(s, tcg_hh, tcg_resh, pos); + tcg_gen_extract2_i64(tcg_resh, tcg_resh, tcg_hh, pos); } }