From nobody Fri Dec 19 17:06:16 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1565962223; cv=none; d=zoho.com; s=zohoarc; b=UPoX082OQpA1nMXpt4crQyxHhAa4OSvVvyVQzn+o2X73n3y0RyZNLTzfh5LLRk8fKGtr1NZaEfHjVbfaygBkylN2VQYg6SE+pt7aftJigSGXlQG2otxGBIOj5e1iKLHCt9D/cSpKfDqijrkXkkz86FThwNYJDXCWaNuzra+IKKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565962223; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=6sDytIs50Z7JPLgJ0D8n+pKl2x0yeciEYsQAfCreOnQ=; b=RsMtYAhfzvBc/uWOUGKCfkXKL6B6t1u7sBdelqsU8WE29c+TCFtpSlUIaooagSw4U4KPkphdw58cGV15KSJllXHdo6EYuNYGmw6J2C0ctHRK2ClAteF9gQgCdz+ArSMw0luJ2gQ2gUq+AtJXrvPEbVr6AFriXzlKW587/grfHTo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1565962223632276.4758584731251; Fri, 16 Aug 2019 06:30:23 -0700 (PDT) Received: from localhost ([::1]:56124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hycJB-0002NC-Fs for importer@patchew.org; Fri, 16 Aug 2019 09:30:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35443) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyc74-0003ZQ-Tq for qemu-devel@nongnu.org; Fri, 16 Aug 2019 09:17:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyc73-0005mF-Mk for qemu-devel@nongnu.org; Fri, 16 Aug 2019 09:17:50 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:38456) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hyc73-0005lT-Gz for qemu-devel@nongnu.org; Fri, 16 Aug 2019 09:17:49 -0400 Received: by mail-wr1-x441.google.com with SMTP id g17so1529124wrr.5 for ; Fri, 16 Aug 2019 06:17:49 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 4sm8705796wro.78.2019.08.16.06.17.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2019 06:17:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=6sDytIs50Z7JPLgJ0D8n+pKl2x0yeciEYsQAfCreOnQ=; b=JJuNxZkWMeOnhvPKAR8W/4qS8Uk4TM+ib8ZouH+2H4uZPRWz6P7O7LmQvyRPpTM3X8 9X4aj3mNxvjNqBzMvPgP7t1V+0QWVkHlIHy5HNzsI9ehBTD4ayRQDtOn8Yzkk13zAgvK g/enkVF/jICbsfr53UaevREngdWDUzOMZ8NwyyVSKzZNFGf88a+Z0G56hYcUIKR65kln x2BskM/EdJF0p05ajwdQFr5lF5O0pN9cD8HylG05EFf4sHlpUYU8ghAuNIbWcUjqMx0Z uOWNbh8IbiMa+VZ3WKp3DNO3UMxme7OOzQwy3o4UCIwYjDeacmNb0wkDc3+1VMVaFR/x 2f7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6sDytIs50Z7JPLgJ0D8n+pKl2x0yeciEYsQAfCreOnQ=; b=kEUOV1y5W/jUK98znevBjKs3i9SKkcl1pjzfQnZe4h+7FrlzafdAIPKrGTPBjdYbXB xJDofGSuJx21Vyx1xkfvPCSb9HMrVXUVsVW5MDed3ILx3Tm17Ov0/1AbYgRtBPJAYVWG z+58TNMFC+m2XWkPvDt9YMEMTxiEIIgt0O3uVCw3Q/gp38mvnQbcXIgzOIwH73oFFOVc oeYEKzznuVlgS4HcxTZ+UugYG6Xbl7UhpMx/8l0fqYhdxqxdF8j0NNyAjdOrylmG8Ve8 KwNA3C4g8lM25yZxV9BOZjWCnFdKCnRsmRBzppARTOMC4vj0kS5rQv5381RWD7dEUnLh sThA== X-Gm-Message-State: APjAAAUiHK9CCSgRxI4nJLkHGgKDtIb8iGN9kubfrK0mn1QfK6TePkr3 tB/aySaE5y9QL2u0ACcDMZ18r4/Vq/Fwig== X-Google-Smtp-Source: APXvYqzuFVjXJiBZfbW1l+O5vhiU2ip77ER8Z4dvgXL79QQa4OHM42LqbJAbDB/Ri5JSEc9HTuBZiQ== X-Received: by 2002:a5d:6981:: with SMTP id g1mr10775771wru.193.1565961468453; Fri, 16 Aug 2019 06:17:48 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 16 Aug 2019 14:17:14 +0100 Message-Id: <20190816131719.28244-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190816131719.28244-1-peter.maydell@linaro.org> References: <20190816131719.28244-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PULL 24/29] target/arm: Use tcg_gen_deposit_i32 for PKHBT, PKHTB 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use deposit as the composit operation to merge the bits from the two inputs. Signed-off-by: Richard Henderson Message-id: 20190808202616.13782-3-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/translate.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 14d6b6d4d28..9c3323509e1 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -8754,19 +8754,16 @@ static void disas_arm_insn(DisasContext *s, unsigne= d int insn) shift =3D (insn >> 7) & 0x1f; if (insn & (1 << 6)) { /* pkhtb */ - if (shift =3D=3D 0) + if (shift =3D=3D 0) { shift =3D 31; + } tcg_gen_sari_i32(tmp2, tmp2, shift); - tcg_gen_andi_i32(tmp, tmp, 0xffff0000); - tcg_gen_ext16u_i32(tmp2, tmp2); + tcg_gen_deposit_i32(tmp, tmp, tmp2, 0, 16); } else { /* pkhbt */ - if (shift) - tcg_gen_shli_i32(tmp2, tmp2, shift); - tcg_gen_ext16u_i32(tmp, tmp); - tcg_gen_andi_i32(tmp2, tmp2, 0xffff0000); + tcg_gen_shli_i32(tmp2, tmp2, shift); + tcg_gen_deposit_i32(tmp, tmp2, tmp, 0, 16); } - tcg_gen_or_i32(tmp, tmp, tmp2); tcg_temp_free_i32(tmp2); store_reg(s, rd, tmp); } else if ((insn & 0x00200020) =3D=3D 0x00200000) { @@ -9802,19 +9799,16 @@ static void disas_thumb2_insn(DisasContext *s, uint= 32_t insn) shift =3D ((insn >> 10) & 0x1c) | ((insn >> 6) & 0x3); if (insn & (1 << 5)) { /* pkhtb */ - if (shift =3D=3D 0) + if (shift =3D=3D 0) { shift =3D 31; + } tcg_gen_sari_i32(tmp2, tmp2, shift); - tcg_gen_andi_i32(tmp, tmp, 0xffff0000); - tcg_gen_ext16u_i32(tmp2, tmp2); + tcg_gen_deposit_i32(tmp, tmp, tmp2, 0, 16); } else { /* pkhbt */ - if (shift) - tcg_gen_shli_i32(tmp2, tmp2, shift); - tcg_gen_ext16u_i32(tmp, tmp); - tcg_gen_andi_i32(tmp2, tmp2, 0xffff0000); + tcg_gen_shli_i32(tmp2, tmp2, shift); + tcg_gen_deposit_i32(tmp, tmp2, tmp, 0, 16); } - tcg_gen_or_i32(tmp, tmp, tmp2); tcg_temp_free_i32(tmp2); store_reg(s, rd, tmp); } else { --=20 2.20.1