From patchwork Thu Oct 26 00:14:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738208 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp553807wrq; Wed, 25 Oct 2023 17:22:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4ox1tOE5go6G54vQMhHBKM4XIdc986QiLN8VCDCKQ5XlicQnJJNYEmfmZS4NUYXtwKk+x X-Received: by 2002:adf:9dcb:0:b0:32d:a29a:b6ef with SMTP id q11-20020adf9dcb000000b0032da29ab6efmr12664411wre.23.1698279736914; Wed, 25 Oct 2023 17:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698279736; cv=none; d=google.com; s=arc-20160816; b=A5/8PnFe/V0V2/2vWkY/qiiliVoRtrN+d3YKQO/GGBTTfBBIyoKORxZaeJd2RJPChk 6+GFhV22sI+rq0Ka8niv3s7jAihkj2zrF3MbbMtEuhRr1RHggjCjR4Pw0uN4U/pBMuq8 kRdqlw8A5ZiGGoJB6OC/eozbODW4rRIAPy2KcTmbe82bw0gEkEmEAol6w+8S+ALATUCt 5p8/lpdsCBB0OCcrNiU3WemFeOtvxSn34QBBp0Btxvkeuj4NLLp9xKPd62k60SRgWELB kLUv7f/wTftnmWkKChtpSQBYGAo/b8uJUkPMOrhO2uBMW5q3Co2tcFNSouhvBUSZJ6X9 yVow== 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=RPgAucB/EvVI7/45p+5WkYALvfhQJlj29a4kXp2aWhI=; fh=J4M4Z4TZxvAT8lkmK1LtxqMjpO7Qiod4IMBL2bk0hxA=; b=hSRiyhRjE4qG1CCoNcAbsnPR53iapMwLe3yMrP2JNeeUKc3VPmvlIs/k4Y/ZjK+PpR 5nwUEk4jlnyTRssZlvREmcYO/fxeqBTwd60aLfAsDSIWw7VYvet2IothQKt+A+nNv2iS NHJHLK3bYo2eRi7P/VY6TIqkyEJW8J4oDQ0uU3HM26mWR8LAV38j8LBjEpa1CgFJlCpC JTYAoHJ2W8LnBOP6UaIq68CbfLoIVPNUvYWGWvxYpgV73t1NwGCUna9oQljVgAJ4a6oi L/cnhgP+zXXxH71J8JhF5Kebf6/k6GI8KRNPkPNtFtWuREVh5yXaAXxZCGHPm58DC7rl LvCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bfalixj1; 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 k8-20020adfe3c8000000b0032d9a2612e0si8345474wrm.538.2023.10.25.17.22.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:22:16 -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=bfalixj1; 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 1qvo34-0007OR-33; Wed, 25 Oct 2023 20:16:30 -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 1qvo2q-00075n-TQ for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:16 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo2l-0004tI-6Z for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:16 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1c9d407bb15so2427855ad.0 for ; Wed, 25 Oct 2023 17:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279369; x=1698884169; darn=nongnu.org; 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=RPgAucB/EvVI7/45p+5WkYALvfhQJlj29a4kXp2aWhI=; b=bfalixj1Kqe1rg2Z0W60miOifocDxef5rcvBHgV4WeFce0m3MLUhYOF134MMskFPNt He4mAWK1TBNJQjmXD3Gtv6aPWl2fiq9Xxuc7XiiahcIBS/hNHrFCYM2xp5tMZjMJmjSD Mn8DQ9/lJKEnWSj1vl1itFclt8VsRtAge33cx21SN7MnrUuoa+tNtt/S47wNsv4y/Q2e w3+Kwaf46y0rGkBugUGtz9cGs9R9E2ChYESidElimVZvjOUgGrMjTMBbswlzhab9wqCE eq8JknOD+I5wcoS6O8DcwGJMzjHOJnhIoLoQUOB/lqDIGB38/IbZeSoXFo4KQOY/3klh J2Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279369; x=1698884169; 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=RPgAucB/EvVI7/45p+5WkYALvfhQJlj29a4kXp2aWhI=; b=Ief/cuz/2SknYY5w28jRkVN+f2aDIzx136/xo6fF8s27c9wwhv+Mx4BJOeVbHQWFW9 zUi0utaEjAAql9DKJAT35Hi+yP/wd5BHMXVtbDhYKvCx5XV6emdi/EsnXM29zGAMmszc voi7VWeAlWrVzgAZWOUWLKLVc61A/FdXrpZuBSLIiahX0mLI96L0JzQrswpXuNntsl2b ImIIvdlav8DK/71N3n8yJSCg+qn0NCyKFsi23fKTxsVyO6bfwQHHr2l81tCdLaSi8b4a qs9O8jTP6yoUAkGEyq0rq+hikihQZzCEl07QYih5R6qB2oMB12iOHDkhOl2TX3a+iZ6m tNpA== X-Gm-Message-State: AOJu0Yyp5qV0UnSRxMboHhalwuSJS+r6QMRxg6pKBudPBJkCVILKA8Yy SZsjOZogDw6MgNmHAyc9Q04m1QFllcHhy/cP47w= X-Received: by 2002:a17:902:edc2:b0:1c6:2d13:5b77 with SMTP id q2-20020a170902edc200b001c62d135b77mr16093034plk.39.1698279369365; Wed, 25 Oct 2023 17:16:09 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id ij23-20020a170902ab5700b001c582de968dsm10038433plb.72.2023.10.25.17.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:16:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PULL 16/94] target/sparc: Merge gen_cond with only caller Date: Wed, 25 Oct 2023 17:14:10 -0700 Message-Id: <20231026001542.1141412-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026001542.1141412-1-richard.henderson@linaro.org> References: <20231026001542.1141412-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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, RCVD_IN_DNSWL_NONE=-0.0001, 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.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 Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/sparc/translate.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 69e85b1842..2664db302d 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1309,20 +1309,6 @@ static void gen_fcompare(DisasCompare *cmp, unsigned int cc, unsigned int cond) } } -static void gen_cond(TCGv r_dst, unsigned int cc, unsigned int cond, - DisasContext *dc) -{ - DisasCompare cmp; - gen_compare(&cmp, cc, cond, dc); - - /* The interface is to return a boolean in r_dst. */ - if (cmp.is_bool) { - tcg_gen_mov_tl(r_dst, cmp.c1); - } else { - tcg_gen_setcond_tl(cmp.cond, r_dst, cmp.c1, cmp.c2); - } -} - static void gen_fcond(TCGv r_dst, unsigned int cc, unsigned int cond) { DisasCompare cmp; @@ -2980,6 +2966,7 @@ static bool advance_jump_cond(DisasContext *dc, bool annul, target_ulong dest) static bool do_bpcc(DisasContext *dc, arg_bcc *a) { target_long target = address_mask_i(dc, dc->pc + a->i * 4); + DisasCompare cmp; switch (a->cond) { case 0x0: @@ -2988,7 +2975,13 @@ static bool do_bpcc(DisasContext *dc, arg_bcc *a) return advance_jump_uncond_always(dc, a->a, target); default: flush_cond(dc); - gen_cond(cpu_cond, a->cc, a->cond, dc); + + gen_compare(&cmp, a->cc, a->cond, dc); + if (cmp.is_bool) { + tcg_gen_mov_tl(cpu_cond, cmp.c1); + } else { + tcg_gen_setcond_tl(cmp.cond, cpu_cond, cmp.c1, cmp.c2); + } return advance_jump_cond(dc, a->a, target); } }