From patchwork Fri Feb 12 18:48:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 381875 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp3200101jah; Fri, 12 Feb 2021 11:26:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+1Wh5rCj7R74bj6D8EfKAd3hJ8ovnRN6o9eH/ibzV36GOnf1Pc7AdmxCSJja7VsTpNEMj X-Received: by 2002:a25:6e05:: with SMTP id j5mr5907780ybc.297.1613158000539; Fri, 12 Feb 2021 11:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613158000; cv=none; d=google.com; s=arc-20160816; b=aowDWqlRBi1C/Wknx73HWJJMmYfEuWyiBQuQyfkQbGzItwWjD4YwDIt+y094do3cZD mhTplejQpp1jJ2VkFzSMvnxk4pBbePF70r7iYXS9JhbF2Xhs0fn+4u/OnIAmKNbZz5uN GbSJ0+V1qW/J3X9khQQi2G4u+cPKMtfzpdGxou9/s2DYwx2CDZxsB+Fu3qhfK7ZAhU+d Z9oVm/vSjORydK2vT7xMupXxXgo36vXLZ3q4b7rB8EpR4TuHS1QKW617jcDD0X6xtM0X rLBdD3ccwnbr49h/9wWK8HotsA4fv9cOYkU9ftpUjTLMLIn6UyjQ7YFyx9T/0ok6tTYB u28A== 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=N1bmJlvzB/Qn12/EBjVNECOmeXAVaIntK2XEeqhnPCQ=; b=Hp3tbxJ0xpuG7jt3AqAQ7MMN7FZpyCaQv6Hl7mzYfgrO5JCMfo+YoP3dWUOJKcHoPl AXQZu7Vf4YwnCXNdPOB8v2u0i2nJ3LX9+reA8+prOl2WLGa8m6A6Xotm8c3qI1XbxM8E ionpBbV99OzSkLpQe8o7NkuniaZiD85lLLaobgeGVnivjFdAxSVBFTejAUgLJbhoAna7 kn3q9U03HfmW2IgrCXq3eHv7aOsRtY8OIFbhMRy6AXb2M97f9pEDvpMvHKVOy/WpVYNv zdgpFS3hv/3HBwu33WIOqgDD7FIyuQwXf7Ba3DZfnBuneDRtqNKVGmDrZJ4b8+5BTNty gK1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bljQLLS4; 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 j13si8493724ybp.459.2021.02.12.11.26.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Feb 2021 11:26:40 -0800 (PST) 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=bljQLLS4; 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]:34488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAe5Q-0007Ab-2I for patch@linaro.org; Fri, 12 Feb 2021 14:26:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAdVg-00026K-KP for qemu-devel@nongnu.org; Fri, 12 Feb 2021 13:49:44 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:56123) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lAdVU-0007qc-DW for qemu-devel@nongnu.org; Fri, 12 Feb 2021 13:49:44 -0500 Received: by mail-pj1-x1033.google.com with SMTP id cv23so128679pjb.5 for ; Fri, 12 Feb 2021 10:49:31 -0800 (PST) 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=N1bmJlvzB/Qn12/EBjVNECOmeXAVaIntK2XEeqhnPCQ=; b=bljQLLS4tK+OxO8FsporHitpFGrh0BpHxyrej8ocahcVlG1+iw0pQtz2o8wuuFk9Kx OQ8/WIyIPDIri0mr7pvmhEoDifULoSxMwNW5508YED3m7CsvcuhxWI4EJlHmNaoxGYZd dMz2969HBYutLHgVBpw5eOZBFV+Xn05Ch+0vp8v4NAlHJ2ancnnPGWGEhv+DG4ZvURoB 7CYd1/GPLHsplpDfzc+8uXRQr+LiHqHAu5cJCLP2s28r32Et1oEeZJT8TFjHKT+KrcfY s+O0uKvmpSNJYB5ArarLGE7JJm70eyH+1tTlISzDGWSEl5j8NLIKwwtfL3aC801X1RMK ieOw== 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=N1bmJlvzB/Qn12/EBjVNECOmeXAVaIntK2XEeqhnPCQ=; b=C0ensBBQ8sU23ZdMGDm+6doaSq9N5uuWtkTBkz1h3/LU6NSFrQ2Jb41Mf8hYQHXU3A qXiATyfEuZPlsommBjQ2Vsnqrdxt3O3ii6osqQtSPxND1RU9KbTNVKmKGNrFPFF13u+G uxTNcbjSfGnHyyh+x0/5pWxPCouOvO5DQFsKjo5UHUJwS49b6fAOmg8rW9TaLDYwimnp TKk0M4s/lxBgRvx3kraU1ytwZuQ989q0kt9jiZo1CAZ0xQVHKZZBxaOQrZpQWXJm8V5P NEnjYq23OZ4Jn0NnD/e/V2iRsoY2Z9CKZyqtAXRV8PM2wlRftrTZ0vI0WENBW7ZSDnRu mJFw== X-Gm-Message-State: AOAM533AN10UOElP0f8ZkOR4WODGPCZQRlYcUlYAxk1WCeQ/0cBFPvcA Npo+7C5akvcbPvP6jBP9xY7onE0bDzNplw== X-Received: by 2002:a17:902:bd44:b029:de:74ae:771e with SMTP id b4-20020a170902bd44b02900de74ae771emr3894351plx.73.1613155770997; Fri, 12 Feb 2021 10:49:30 -0800 (PST) Received: from localhost.localdomain (174-21-150-71.tukw.qwest.net. [174.21.150.71]) by smtp.gmail.com with ESMTPSA id k5sm9427618pfi.31.2021.02.12.10.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Feb 2021 10:49:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 21/31] target/arm: Improve gen_top_byte_ignore Date: Fri, 12 Feb 2021 10:48:52 -0800 Message-Id: <20210212184902.1251044-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210212184902.1251044-1-richard.henderson@linaro.org> References: <20210212184902.1251044-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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, 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" Use simple arithmetic instead of a conditional move when tbi0 != tbi1. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) -- 2.25.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 1c4b8d02f3..b23a8975d5 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -183,17 +183,20 @@ static void gen_top_byte_ignore(DisasContext *s, TCGv_i64 dst, /* Sign-extend from bit 55. */ tcg_gen_sextract_i64(dst, src, 0, 56); - if (tbi != 3) { - TCGv_i64 tcg_zero = tcg_const_i64(0); - - /* - * The two TBI bits differ. - * If tbi0, then !tbi1: only use the extension if positive. - * if !tbi0, then tbi1: only use the extension if negative. - */ - tcg_gen_movcond_i64(tbi == 1 ? TCG_COND_GE : TCG_COND_LT, - dst, dst, tcg_zero, dst, src); - tcg_temp_free_i64(tcg_zero); + switch (tbi) { + case 1: + /* tbi0 but !tbi1: only use the extension if positive */ + tcg_gen_and_i64(dst, dst, src); + break; + case 2: + /* !tbi0 but tbi1: only use the extension if negative */ + tcg_gen_or_i64(dst, dst, src); + break; + case 3: + /* tbi0 and tbi1: always use the extension */ + break; + default: + g_assert_not_reached(); } } }