From patchwork Fri Apr 26 17:24:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 162952 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1008463jan; Fri, 26 Apr 2019 10:30:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSR+yXmGqtExEv2ZN32F8KgBdjrwrI7LnBaSoMY8f12+ebrIJNL7wP5m/k/5UEaKuIZBJk X-Received: by 2002:a1c:f504:: with SMTP id t4mr8415897wmh.121.1556299811584; Fri, 26 Apr 2019 10:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556299811; cv=none; d=google.com; s=arc-20160816; b=mAPQCn4iMkbxxZ7l1Fq+pDFU+iYlyn1NIvmszg5f6Qk16vsFp+g7zX0AViC9aa8RDM wqAAG/V9T6wotZrXMF2lFmGrqr1BrVMndjPAoKaL/1nv3SAFyJyF+gEnu4xwn2JdIz00 8MSkFhCyX7tyJNZVtXTo0Ibf1jVRITRsVvhnyNMwR+fcpSGy/xVYaAUgNOj+Nur1SjfQ QsX7etdbuA1JS4GF7ymhxQvxICub0Yswfr3u9euVnBtgopKpWltH1izbHK9Eyxq3vHUt nXfFfBEpqxv6ISlrSWBzz+W3xca0Wqf0ATYC8rtOtvycwjfILg/gycbXPWHTaF7t9u4y K66g== 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=KIh7KhTzHMM8NImyp8JEXp0cQ6SpWRDrI20KK0RXxhw=; b=eOYbrzmDV6jPY6Te95BO9ctq5umvz4fXHXCt54OnYVfBDgkCpLsLh4bgiSxG79VLXq fjrgSCBD2K0io5oizSeGmANEC3CA6ZfJHumVkmaStjPCRMC4yYOIGdT4ZoDw6zaJUbMz ++2pmXZmaM9HdCKUXDWaW1hYjuXiQICBYvwuW+1+H6zS8ail617FSV/9Qo05lU/fBXfF xn1cUqJf6MzTpcVEPQnvXsKwaKVZaNJdgMgmx+xulyoxNhSK7xm/n3vdncNwS7Rbpe5Y 42t/SSDDPThDMrsWW/rjNRLK5yCjym4HAwg0pBRRLiWo17VAmFhCUOrxrjqx3PXavOe8 Bryw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RUD6SG1Z; 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 l5si6365338wmc.117.2019.04.26.10.30.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 26 Apr 2019 10:30:11 -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=RUD6SG1Z; 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 ([127.0.0.1]:49978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hK4fq-000513-G7 for patch@linaro.org; Fri, 26 Apr 2019 13:30:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hK4aN-0008Pw-1R for qemu-devel@nongnu.org; Fri, 26 Apr 2019 13:24:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hK4aM-0006K6-0w for qemu-devel@nongnu.org; Fri, 26 Apr 2019 13:24:31 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:33395) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hK4aL-0006H6-QN for qemu-devel@nongnu.org; Fri, 26 Apr 2019 13:24:29 -0400 Received: by mail-pg1-x536.google.com with SMTP id k19so1949076pgh.0 for ; Fri, 26 Apr 2019 10:24:29 -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=KIh7KhTzHMM8NImyp8JEXp0cQ6SpWRDrI20KK0RXxhw=; b=RUD6SG1ZAQoiyJlACWpf6TIBHo4ZYQM5bO68uDlgzjPw0tIRxlfZo3cMdJ27zJTdkE iqF4NYY1HDFzR86HDPkr8ZJ+dgJL+gXPSHZpLLF4obU1EkwYXpbGWiYK0qktKU405NBf eUBv9g35G9dTj7jbB1KkGtpMhz9XztsedbpArL6IXdOA138N0KYK2dTAlGytU1XMBajY FMz+bH/cZWWEcc22IBnEjHF/Q5DybaeoFPC26eXiNO/Jnd210KH5ibmwh+l4JwVPhAPr /TvbXkVuw975PCcPW4gENxH0IXrzBBMW/dJ0ZZlbk6FaPVrJo9fHXw4oMTRfeNhdDTUD 2UyA== 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=KIh7KhTzHMM8NImyp8JEXp0cQ6SpWRDrI20KK0RXxhw=; b=CdWRtcdFBY8qKH3/+SKaFkAzSdJM2INE07gzaschLE8Ko/OZMw7bgixWtxyn9mvLcF j4MvXTPA3h8dWRTJ1jQK7j0yA2dOo7UNuam/YTEF+TjjsWNnv+CFchISEGZTGGjltrHN 6AtOwapD2bZt8s1i1eflXpmrJ03fj21tzvMG8UnTV4aa+u6pNA4hpS0T1yVAisMO65Lb /rQlwdpwv4BRSuJPwN4zyvCRw4e2Blqnun5bSQCZPqKclZh05hX8pp8pNTPudoZMjcbE TnbIflRoU/tFawR4aqxRD6qQrsnzxjBBeYeHVDHgtqUbAUF01EmDhnYE0gVgDlWw1Rhq T3fg== X-Gm-Message-State: APjAAAVwq5q9AqDhl2w8kDnfqL8TBBCH7yJHFDPtTjSrfM6bCyaT55tT hs9U3sZ4a0Ua6+A6iCJeGfHt78uZFs8= X-Received: by 2002:a63:4a5f:: with SMTP id j31mr41802609pgl.369.1556299467178; Fri, 26 Apr 2019 10:24:27 -0700 (PDT) Received: from localhost.localdomain (97-113-179-147.tukw.qwest.net. [97.113.179.147]) by smtp.gmail.com with ESMTPSA id j5sm7901762pfg.186.2019.04.26.10.24.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 10:24:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 26 Apr 2019 10:24:09 -0700 Message-Id: <20190426172421.27133-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190426172421.27133-1-richard.henderson@linaro.org> References: <20190426172421.27133-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::536 Subject: [Qemu-devel] [PULL 03/15] tcg: Use deposit and extract2 in tcg_gen_shifti_i64 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) -- 2.17.1 diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index deacc63e3b..fbc70649dd 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1355,31 +1355,32 @@ static inline void tcg_gen_shifti_i64(TCGv_i64 ret, TCGv_i64 arg1, tcg_gen_shli_i32(TCGV_HIGH(ret), TCGV_LOW(arg1), c); tcg_gen_movi_i32(TCGV_LOW(ret), 0); } - } else { - TCGv_i32 t0, t1; - - t0 = tcg_temp_new_i32(); - t1 = tcg_temp_new_i32(); - if (right) { - tcg_gen_shli_i32(t0, TCGV_HIGH(arg1), 32 - c); - if (arith) { - tcg_gen_sari_i32(t1, TCGV_HIGH(arg1), c); - } else { - tcg_gen_shri_i32(t1, TCGV_HIGH(arg1), c); - } - tcg_gen_shri_i32(TCGV_LOW(ret), TCGV_LOW(arg1), c); - tcg_gen_or_i32(TCGV_LOW(ret), TCGV_LOW(ret), t0); - tcg_gen_mov_i32(TCGV_HIGH(ret), t1); + } else if (right) { + if (TCG_TARGET_HAS_extract2_i32) { + tcg_gen_extract2_i32(TCGV_LOW(ret), + TCGV_LOW(arg1), TCGV_HIGH(arg1), c); } else { - tcg_gen_shri_i32(t0, TCGV_LOW(arg1), 32 - c); - /* Note: ret can be the same as arg1, so we use t1 */ - tcg_gen_shli_i32(t1, TCGV_LOW(arg1), c); - tcg_gen_shli_i32(TCGV_HIGH(ret), TCGV_HIGH(arg1), c); - tcg_gen_or_i32(TCGV_HIGH(ret), TCGV_HIGH(ret), t0); - tcg_gen_mov_i32(TCGV_LOW(ret), t1); + tcg_gen_shri_i32(TCGV_LOW(ret), TCGV_LOW(arg1), c); + tcg_gen_deposit_i32(TCGV_LOW(ret), TCGV_LOW(ret), + TCGV_HIGH(arg1), 32 - c, c); } - tcg_temp_free_i32(t0); - tcg_temp_free_i32(t1); + if (arith) { + tcg_gen_sari_i32(TCGV_HIGH(ret), TCGV_HIGH(arg1), c); + } else { + tcg_gen_shri_i32(TCGV_HIGH(ret), TCGV_HIGH(arg1), c); + } + } else { + if (TCG_TARGET_HAS_extract2_i32) { + tcg_gen_extract2_i32(TCGV_HIGH(ret), + TCGV_LOW(arg1), TCGV_HIGH(arg1), 32 - c); + } else { + TCGv_i32 t0 = tcg_temp_new_i32(); + tcg_gen_shri_i32(t0, TCGV_LOW(arg1), 32 - c); + tcg_gen_deposit_i32(TCGV_HIGH(ret), t0, + TCGV_HIGH(arg1), c, 32 - c); + tcg_temp_free_i32(t0); + } + tcg_gen_shli_i32(TCGV_LOW(ret), TCGV_LOW(arg1), c); } }