From patchwork Thu Aug 8 20:26:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 170833 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp9059405ile; Thu, 8 Aug 2019 13:26:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPmDCpcdxRQcfnw3z5OMKAz7sSA18lq4JGtQRhoB0PFeDU/84WCAxFC0neJ0d573MplPC0 X-Received: by 2002:a50:f285:: with SMTP id f5mr5146913edm.109.1565296014274; Thu, 08 Aug 2019 13:26:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565296014; cv=none; d=google.com; s=arc-20160816; b=Awu8rPBKwVa+j+xE0E1sGC5nJt8AcDrByeA2fUMMWHT/Pu7rf5VTETWdxei5Mzv+de MrqarJn80XEccj0XyezyC41Zj8eSuDD97wokPdt/snVSurzk3Hh9QZm3UEBpggckvr1n y/q5d5NlxU34R2RoaUfT6uy8VIF1C1f+W4wvT+wItstxmCJkypkwnxU7MtQI/iA9vDgb 7P1jmz/qtZPyWoJpkEtCUeYnCeKiKUUhf4KAEPp2RbM5DLUuEeurOyDG45u6oBiaqZ7F D3bzVI6SEb4vAHSnna3/b4DiGSq65jJXH+ckN7F8hbO2FCMse5BGyrVupIMRfk3LX3mW vvzA== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=h5Yd6DdTtsmby24hx/qMc8uUeIQaxSevj10drk1jtIY=; b=BV21KDWgpfaLy2KQI82SuYAX5VzYxusCpIgH1NNcNFUFbih+oXhergej/M++nLkJy5 bb42ZKsBaRLqVIAqN8jJHBeQkMDLp25Ix+Sq/J1ZkVC9JekWObHYlajtbUeCN5JAtOTS iD7RLGnNZ041e4+brVKH5kzjBVKWItJiEEMUZrm2FCH+22IaXwKhCQOJzpjhXj6bbezl 8DeUg/+nCQciTEkbraLc7bx+vWC6m35diC8RlrfbWpZS1rMdetk95vW6seeBD/x0rzV7 +gYsYs38EtiI9Nqv5SCQ52EqNOYfJb8C0BuPjTGUI+bwa6zZSpe4MGS4+lqEPo4uhZDl 6gvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=li+g5mWa; 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=fail (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 d16si36497235ede.18.2019.08.08.13.26.54 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Aug 2019 13:26: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=fail header.i=@linaro.org header.s=google header.b=li+g5mWa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvozt-00075p-6s for patch@linaro.org; Thu, 08 Aug 2019 16:26:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59793) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvozQ-0006yi-0c for qemu-devel@nongnu.org; Thu, 08 Aug 2019 16:26:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hvozO-0001FS-V4 for qemu-devel@nongnu.org; Thu, 08 Aug 2019 16:26:23 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:40800) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hvozO-0001F0-Pp for qemu-devel@nongnu.org; Thu, 08 Aug 2019 16:26:22 -0400 Received: by mail-pf1-x442.google.com with SMTP id p184so44721210pfp.7 for ; Thu, 08 Aug 2019 13:26:22 -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=h5Yd6DdTtsmby24hx/qMc8uUeIQaxSevj10drk1jtIY=; b=li+g5mWavems3tksgkMZq3hJ9EOkVKYmGHT+B/KsA1qEQ6FcVD/xNWJpaH/BKO7q/V 4ze8IUbDi4v+DBlMLcNBT0I6s1P1F0DPMSGVKYujQaj+2spoJ8yApsRUfwTNtdFOisnW N+o5T8oXhAN9j2xKJ+2cz1Um3LlNkyWxkRrmeM4Smlx2iC2x/PKoGxUhXRV1Hi6lCS2J otjdKO8jyxQZjaYkPNwJqRCAFr6VRWn74uFVSHrE9v+8SeGwMQ3Mcwn1zNSRPTOLFGMR i+aVWsTAt9WlGVYsNuoKNVGeXACrhZcKUSvIFunRUR99CLl6UMag9uBcCg4x8lApj3Yf F1cQ== 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=h5Yd6DdTtsmby24hx/qMc8uUeIQaxSevj10drk1jtIY=; b=GyWUMlE023zautPAiTLN3d+e22EypFaEiZQrN1QrjtRcHjTo0rE43O49/IEgccO8hb lR9TG0+sUcmmYy0ptyktUC6ZNP41C43jz2ROjlRGOlO0k72aBAjFrzLOuUN+Tf3wiI91 jqGn+JH7jgGpezW5Tj1anRbHUPnu+GeeUpjW4VZltoG35WPBkGSSoNPIjidOtSPvodqi nNK1Q3JaoHt4fztk69eqkV3MB6XuBkUvzxGNZVK2zS0FDncVlivP8v5D/XtgZ86Ptvp9 2p1N0LeOohPNtLGeWrqS0CsHU4Qo3gVUwSJZ1bLzccmTI+4wqX7lXLwI66IVlA9Fsb8i RMHQ== X-Gm-Message-State: APjAAAXIpYwIkaPI345abLcw/iObTf96hJAYVSzP5ddCzZJQV+uMzN5q c1b7E184RpUAYqQyNKdaSvOsivD8oa4= X-Received: by 2002:a62:cd45:: with SMTP id o66mr17681624pfg.112.1565295981490; Thu, 08 Aug 2019 13:26:21 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id v12sm2850146pjk.13.2019.08.08.13.26.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 08 Aug 2019 13:26:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 8 Aug 2019 13:26:11 -0700 Message-Id: <20190808202616.13782-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190808202616.13782-1-richard.henderson@linaro.org> References: <20190808202616.13782-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::442 Subject: [Qemu-devel] [PATCH 2/7] 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use deposit as the composit operation to merge the bits from the two inputs. Signed-off-by: Richard Henderson --- target/arm/translate.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) -- 2.17.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index 43e005d191..94170af134 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -8769,19 +8769,16 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) shift = (insn >> 7) & 0x1f; if (insn & (1 << 6)) { /* pkhtb */ - if (shift == 0) + if (shift == 0) { shift = 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) == 0x00200000) { @@ -9817,19 +9814,16 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) shift = ((insn >> 10) & 0x1c) | ((insn >> 6) & 0x3); if (insn & (1 << 5)) { /* pkhtb */ - if (shift == 0) + if (shift == 0) { shift = 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 {