From patchwork Tue Oct 17 06:11:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 734254 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp322130wro; Mon, 16 Oct 2023 23:13:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGlgDEF2OERQ4rBhwETi3I2PnOd810XfRkp1erxpE8qOp+ppw/UWTycJr5xA18npZF4j928 X-Received: by 2002:a05:620a:3950:b0:777:f6ad:783e with SMTP id qs16-20020a05620a395000b00777f6ad783emr593118qkn.20.1697523222593; Mon, 16 Oct 2023 23:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697523222; cv=none; d=google.com; s=arc-20160816; b=eOLou1+x08AvC9aYvVBAgaRr4kxasdiKSi/ftVmrIGUm391PxREZ0y7sKs43mKJ+BK 4CtzwqHEIwXfJff/McBVvnhpRtJ9Nui/CPKY9NbX8jJ+ECeT9u7Ir5OjUBrHiI6Cz6Ht sAj7ySDrNUgBgQAVq4K9MjCS+G0hgZKb/JfrSIOlV+4YnXtxhvHtU89jRlVWm8TzyAFV ZtiTr6VUc66RRMncepC/IQpzU5gufregIju7FgQ5dU66RXwPmXNQWdJDEeGFUw3Iq/Eo 6xTAFQwg+qMTLL2o9TAlN8RJ2jRafvW6xyOqmmr6hYTXbNh9AT4IYyn/k9aT0Q4N5J9W OZaw== 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=LRsXuHDffyQpwn6iwozzaEFt19iWrF0/6hbYZNaItec=; fh=GkmytpQ/aBK+SnhsUxtqa1dYh9qnVue5D4c8ejqHfb0=; b=bALxvjAh+M8X37QVJa5hprYoYJhKTOkQSo0Hu/+yEKtmwXzznOuXnS39C7rkTMMw+v XUnTbGgq6BJg+m8D8wJ5xPW537BqRYpnnueLtuOfu5CK1debUO0K/y7QyjzPtCdQnU38 +MUX5MZpyWJqqcv6xyBiVSMXnNwe0d3vLdwht9B1PkYR/p6Ct6qeLtWbbgjSSEHx0Ulw 8Mqk5/3bIQXT+Zf9IAOrZMAv6AZDwat3IjtIOSYa8anJGAZlqHiLLa4fgaM+AUJfmKpQ 0xj61sxucTeV2sMqsmcgzfXkNi8FuWPCQJpPigfWe4Z92D2XBdigxVxcrz86N+xtnYxt BbdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ggdi0o94; 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 y12-20020a05620a44cc00b007759f9416easi600840qkp.635.2023.10.16.23.13.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2023 23:13:42 -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=ggdi0o94; 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 1qsdKC-0000Dp-7Y; Tue, 17 Oct 2023 02:13: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 1qsdKA-0000Ca-JJ for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:13:02 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qsdK8-0003sN-Vp for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:13:02 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1c9e06f058bso35619145ad.0 for ; Mon, 16 Oct 2023 23:13:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697523179; x=1698127979; 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=LRsXuHDffyQpwn6iwozzaEFt19iWrF0/6hbYZNaItec=; b=ggdi0o949RNen9dKjvI4D3PY6M5SwI6LencNnYWbShsr+l1KKX4ARr0reUIPB5XmdT 6CjAOKLihF2ZRuP1vyuFOov6f/QYzhAScd43a5I7gZGjZmmbIvvAnJlWi56Vbedi1UVH M/pKSJBgZPpK7ceKylkAF60NaXo5equzICdSA6S9Tkm/hsn+Rqx8isdLKT4MGgzQkJBR M862+rXWfp1jalrtHyiLaCREeATF6/h+VxD0K0/L7XI1RRX0jrtXTWwQlxQMSs96/BdB 1zze5mqoP19LhTd7EoFbxJ0BLhAq7aVj8sFLyJm1Iv6HebY+Hy1bgcpJpYNHzei9gQhM 0Oig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697523179; x=1698127979; 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=LRsXuHDffyQpwn6iwozzaEFt19iWrF0/6hbYZNaItec=; b=MwhpmQjwqzbju4JJBqbAovvQ+uN6h5urTgn8TJrhqYRUbFpoVZDGLeRG99c5aVo92z +0pab4dZuCbpH49XkS+oewq855x2zgX7tTgldP1Y6iKPKLago7k+C79O+pbKuvrX1mud vU+EvtW/qzzfJ5YTOyStQ34X/+ihc+g9qvK0OK4Y3sYJjsnaWIHL9B6A3Zr9r1TRv5A8 vYU/26ShWHxPsZbxju0E8+6md0LB8DKmZ8F8VB0Rp9q3S3e6Vi3Y9MjTpTvI/+1C6btd DBBWNa93WocYxWn3i+nzmrku1B8WDMYsdkrhTbzoQVjj1NYrsJUWpxBdI5axBzxaDa+D J5vw== X-Gm-Message-State: AOJu0YyN76Vjqz0bXbuKox7Jv2uwzeqszUSsH1zFJ8+1lOEWt8fgIba0 xwJygIo+oPpBuKh02G8vl50Z/UOuaDBD54Prhmw= X-Received: by 2002:a17:903:4346:b0:1c9:d358:b3d9 with SMTP id lo6-20020a170903434600b001c9d358b3d9mr1329367plb.18.1697523179553; Mon, 16 Oct 2023 23:12:59 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id jf4-20020a170903268400b001ca21e05c69sm629150plb.109.2023.10.16.23.12.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:12:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 16/90] target/sparc: Merge gen_fcond with only caller Date: Mon, 16 Oct 2023 23:11:30 -0700 Message-Id: <20231017061244.681584-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017061244.681584-1-richard.henderson@linaro.org> References: <20231017061244.681584-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/sparc/translate.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 61a75b5fab..cc19f0606e 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1304,19 +1304,6 @@ static void gen_fcompare(DisasCompare *cmp, unsigned int cc, unsigned int cond) } } -static void gen_fcond(TCGv r_dst, unsigned int cc, unsigned int cond) -{ - DisasCompare cmp; - gen_fcompare(&cmp, cc, cond); - - /* 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); - } -} - // Inverted logic static const TCGCond gen_tcg_cond_reg[8] = { TCG_COND_NEVER, /* reserved */ @@ -2990,6 +2977,7 @@ TRANS(Bicc, ALL, do_bpcc, a) static bool do_fbpfcc(DisasContext *dc, arg_bcc *a) { target_long target = dc->pc + a->i * 4; + DisasCompare cmp; if (gen_trap_ifnofpu(dc)) { return true; @@ -3004,7 +2992,13 @@ static bool do_fbpfcc(DisasContext *dc, arg_bcc *a) return advance_jump_uncond_always(dc, a->a, target); default: flush_cond(dc); - gen_fcond(cpu_cond, a->cc, a->cond); + + gen_fcompare(&cmp, a->cc, a->cond); + 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); } }