From patchwork Tue Aug 8 03:11:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 711559 Delivered-To: patch@linaro.org Received: by 2002:a05:6359:d30:b0:129:c516:61db with SMTP id gp48csp1915620rwb; Mon, 7 Aug 2023 20:15:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkdavsPy2ji97mttvxpoTSfAZeDWmzIIl0bd9362P15pAFybrRsG3vauITR1zzEb9y90Bz X-Received: by 2002:a05:620a:1a1f:b0:762:499d:d9dc with SMTP id bk31-20020a05620a1a1f00b00762499dd9dcmr15485525qkb.54.1691464505288; Mon, 07 Aug 2023 20:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691464505; cv=none; d=google.com; s=arc-20160816; b=HV5drWBNsPPNf80eXMxokxKMUtVL3toHLYAYhSDEpvY3yXLVsQNgIgYF+JvnVhhcO0 a1RSSr5I0ebXPKnyauII9dsmK8cZGZMsDoUzCKIyXKnBJIVPWaSnE8MzHAWehhXIrAly 3lFhoN/v9/s6fbRs7I4EbUS6efTH2+GBPE8h7/EYG/Be3rjbBSLtxu7buHbZ6VLW8eso fAXs5Z9/P1pKNPErylPW6E2WDnUDv+kyqccZfnX07/afVXRtTPlcuSu66QQ9F2y+yuxd ii1ZLYCORQBfrGz7qwm2Z2U7eZqXU7yygxnRbsBF2JDUxVP4MxfgbZftcz1h4eQ7uq7M vs0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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:cc:to :from:dkim-signature; bh=g8a+pmsyT7JaiJjb96T8aB4eik7cv3ApHNhItnmJcZ8=; fh=hqs26moy805PsHbwd88lUczy2QdlfF59ojSMxj/DeWg=; b=P7tPy1ylhMwL+QOz6V1/cWaOL1yhTOvk/VgIciwf0ylNpox1l3I1oFhJ+64MS7cmMh ZBDK4vS6T4hyrCvYbjq0hSa6PjhsgUe0aRzJ9szg80VxOLlJ2vFSYGPVuLWaJo20sM1G e98N3aZhdjBGMQmDOc8TrOOFfSbllqbknrNU/ILciaOJof8wqBdBCLOsMdVMWhjd6J2M 8QS9ChfRPSDTjpAlzGZ1bhWJ2rpu9My6q9WCKkzNBGjcXnA5aVVr/gANJyRzKL60+A4X NLHXlGKE5Vahc/BltMcL3yIczBrrPMpaX9w/jinGiDaY3dwtZQlwgocuphWatpLiDfce gUAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aJ7FU4JQ; 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 f7-20020a05620a20c700b0076ccb07897asi5796644qka.673.2023.08.07.20.15.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Aug 2023 20:15:05 -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=aJ7FU4JQ; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qTD8e-0000V1-F7; Mon, 07 Aug 2023 23:12:04 -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 1qTD8c-0000O7-FY for qemu-devel@nongnu.org; Mon, 07 Aug 2023 23:12:02 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qTD8S-0000Bf-UK for qemu-devel@nongnu.org; Mon, 07 Aug 2023 23:12:02 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-68706b39c4cso3593228b3a.2 for ; Mon, 07 Aug 2023 20:11:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691464311; x=1692069111; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g8a+pmsyT7JaiJjb96T8aB4eik7cv3ApHNhItnmJcZ8=; b=aJ7FU4JQA13xkT3Lu3km5N5DbjXZLQAa4sbHN2fBfxqTUKsmlbvfFl14CDBwJsVaLP T06mnOuI92/VhXSmPz0+emVQZOBz3AQlUCb39Q5yrVRl4JJboSyZLpg1jNN6SEWZR2SU wd+bXbOUE/MB0WVQEeuDepoZwygh724xFnJ80iWK80lUWkYwI2G2TPkWbc39PUmZHgJX 9eTumgWAY9ipiYvPyZyfjUNOfqed3aLRuhj5Tvzk2tvlJ7gLfYNrP1kF3jxTrlwKCUW0 MxZL5vhaxTudJizVoP0XXmjZT3PXjiPLqzaMGzjyenUIrm7pmDXbycZ12HtiwXwsIhAE OpKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691464311; x=1692069111; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g8a+pmsyT7JaiJjb96T8aB4eik7cv3ApHNhItnmJcZ8=; b=GTYrveJhU2mvJKvIytU2sXPdkQSAHCW+BGYUrv3LSAj8qYnJN6xwCz4IR94tfhzefZ /Cusi1uGK+mTy1uvr9VeJM7awhOxshZDVfJYbGgsG3h4k+K7OmBJtH0PAjHLzSrFqJIb C3ErucmyuncE/vXrbTUfnAFzRJsy9Kg3STW3U7gG4Ydq0Vb76/Hgtxbm9aEF2ipIPIpM +kiZUo/Dquplzf39NleQq3uEUxQtswrXlX9tVHsZk2sFRx968HRngRrwPULb+NQr1zJl 0P4LzJfskUla2nJPKKiHgQRIYl/iBTHGx5JA+NOr1FjH50kdz+Ho6pK2pP+kOqF6QDM1 8/PQ== X-Gm-Message-State: AOJu0YyFlsNviQ5U4GxqoD2L0smJkpMMYZedqsBY5zP2ndYrHj+BhyOv 74NBiNO2skqxX/xRCG7Eg07XKvKIvhykKOkZZAI= X-Received: by 2002:a05:6a00:1a54:b0:687:907f:487c with SMTP id h20-20020a056a001a5400b00687907f487cmr10972103pfv.19.1691464311578; Mon, 07 Aug 2023 20:11:51 -0700 (PDT) Received: from stoup.. ([2602:47:d490:6901:e306:567a:e0a1:341]) by smtp.gmail.com with ESMTPSA id g64-20020a636b43000000b0055bf96b11d9sm5639087pgc.89.2023.08.07.20.11.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 20:11:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org Subject: [PATCH 08/24] target/sparc: Use tcg_gen_movcond_i64 in gen_edge Date: Mon, 7 Aug 2023 20:11:27 -0700 Message-Id: <20230808031143.50925-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230808031143.50925-1-richard.henderson@linaro.org> References: <20230808031143.50925-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, SUSPICIOUS_RECIPS=2.51 autolearn=no 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 The setcond + neg + or sequence is a complex method of performing a conditional move. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/sparc/translate.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index bd877a5e4a..fa80a91161 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2916,7 +2916,7 @@ static void gen_edge(DisasContext *dc, TCGv dst, TCGv s1, TCGv s2, tcg_gen_shr_tl(lo1, tcg_constant_tl(tabl), lo1); tcg_gen_shr_tl(lo2, tcg_constant_tl(tabr), lo2); - tcg_gen_andi_tl(dst, lo1, omask); + tcg_gen_andi_tl(lo1, lo1, omask); tcg_gen_andi_tl(lo2, lo2, omask); amask = -8; @@ -2926,18 +2926,9 @@ static void gen_edge(DisasContext *dc, TCGv dst, TCGv s1, TCGv s2, tcg_gen_andi_tl(s1, s1, amask); tcg_gen_andi_tl(s2, s2, amask); - /* We want to compute - dst = (s1 == s2 ? lo1 : lo1 & lo2). - We've already done dst = lo1, so this reduces to - dst &= (s1 == s2 ? -1 : lo2) - Which we perform by - lo2 |= -(s1 == s2) - dst &= lo2 - */ - tcg_gen_setcond_tl(TCG_COND_EQ, lo1, s1, s2); - tcg_gen_neg_tl(lo1, lo1); - tcg_gen_or_tl(lo2, lo2, lo1); - tcg_gen_and_tl(dst, dst, lo2); + /* Compute dst = (s1 == s2 ? lo1 : lo1 & lo2). */ + tcg_gen_and_tl(lo2, lo2, lo1); + tcg_gen_movcond_tl(TCG_COND_EQ, dst, s1, s2, lo1, lo2); } static void gen_alignaddr(TCGv dst, TCGv s1, TCGv s2, bool left)