From patchwork Mon Feb 20 18:40:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655107 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1551796wrc; Mon, 20 Feb 2023 10:43:44 -0800 (PST) X-Google-Smtp-Source: AK7set+plrHRVjmkTBckSsbEYzfhf5ak/Rg3nFzTUJ0zGV7KPNkyPrjbBxOLKndyJ04p3WBFqmD3 X-Received: by 2002:a05:622a:d6:b0:3ae:189c:7455 with SMTP id p22-20020a05622a00d600b003ae189c7455mr19078101qtw.47.1676918624731; Mon, 20 Feb 2023 10:43:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676918624; cv=none; d=google.com; s=arc-20160816; b=ICTCA9KwVR+r01gVftYRUydCbNCFW469ei+PzfJhsux+HqNgmw8eVdwkksFzAcC5T3 j0a/O2i9wjhM68Spg9hPFCXs4xYJyKvS8n3lEf/mnfhnwlDaNWG5XSJ30gqoeQr5YbwH 6d8FkWml+QX/ddwsoYG4PqIg8roIxTBD+WWl3CWEHLGBkYjMCkcmtG4Mz7n0SfmWYh5d hAWYq+Zb0Biz5GsLbPee1awqjJoL0lVm+dz4yWVq/pTS/3CIE+9aa/SVeg78fHLNWHdI wJgNz/HBQiInpUhb0RsmvJw1WtP+dQtKFtjjLT9IOuDoT9J1hHV/ZuOkorBEj1nDbla1 cNCQ== 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=4uWfLRIfJk8kynH2znY8EtkUuU9POntvMHrtKgCos1g=; b=RJt0bgYs/whsXF1OnpVxNA5qwMwkRJEwaSuEPsonXFCRfA577+az0giiRgphPJnjOI VzPz2LIc+3xUdZ8RAH0PGIxTY2z0MAYKC6Sco8mmcmbd3i+a+UNRDNNHyj7p9YyHwZZV vcGIqXBSoHiKkgKtzt4fLc3dUmQqlaSa66RsXHjTXp2QCQOM0nJFMrhKFHkECHiZVdwq L7QV380n7Ru2aj3iJq4lSz4Y6dK9pdSQ0gztcMsTCG4gBrsaQdeo4X1XHm7Wj5Xk8Liu OrWZ8rsnJY7OXgXuvthjpvirjsiJffZlGduEt8B0BW358atROoGSREc9Gq13idKysM3Q 6UtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OzuxOo1f; 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 m15-20020a05622a054f00b003b818472c14si292552qtx.468.2023.02.20.10.43.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 10:43:44 -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=OzuxOo1f; 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 1pUB6k-0004ku-Rk; Mon, 20 Feb 2023 13:41:50 -0500 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 1pUB6Q-0004XI-4l for qemu-devel@nongnu.org; Mon, 20 Feb 2023 13:41:34 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUB6K-00044o-VL for qemu-devel@nongnu.org; Mon, 20 Feb 2023 13:41:28 -0500 Received: by mail-pl1-x631.google.com with SMTP id q11so2822459plx.5 for ; Mon, 20 Feb 2023 10:41:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=4uWfLRIfJk8kynH2znY8EtkUuU9POntvMHrtKgCos1g=; b=OzuxOo1fwaD4OM+KS6DQ9ysd3Grl2m21EX7DuIotwt+Bb9788wTEcyU5CAEQl4tkzK sspxZ9O72hxflQ7bCAjI0MVheZu6+5DfGzpV0Ae9NxwznH18k73FA8HiFDfpSEHH3iN7 L+m7rrwi8mLaS+4XvDKclB00s7KSPMiD15TrKex5ukZoBizIEcGWgg1iQvFwXVj1jRon CABH414+XiUBTKXFRDFLOyP/KpiZdmltnvDVkzsarygILEvWDIfU4sIYkjySk/6OlXok bG1gf6h2OBnfiQ425/5sQCsXLYftBuWgxPvEPwlIvKVVicfUJRpYpw3iDkTWpcK8a1VH BjFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=4uWfLRIfJk8kynH2znY8EtkUuU9POntvMHrtKgCos1g=; b=mJTRbPuW/yQ+mzTIvlYD0MhRInFGZulMOl1MmKGknyhXQsRO7NiwW/Kp/jueK16+Lj x5b7VA4BUMPftIjtkz8LI0Xj71PhrzpH4oOHdP6ZeLMrLYuoU0ZGEfGUVHgFlxRlScSB fe+Tb67I7RdvZJwzIge5xt7zGxUXvRNLEFqRfMEp+8WfHackhIjVBqRe2pbUWTkzbq0S PgeeyDlvBKcXjZHmHdLQKm0gczxXMn/aoIhPXGPrag+Y7s/yP+8p7lgLTd4QzHa76ro9 1+McpIj4BCmU9Va0WWKahcfO6sFEjkotCGVuEL+C15o+TVYvTeJRDTh82/PXZecFiK5U E23w== X-Gm-Message-State: AO0yUKXd9y28LyqS99evbctZAwQ2PeWq5UJaN9DJc3mCIIu2CtFz4b8M pUL04O6dKLayF7zKuxAcPy89Ie7ub5GTUnC8xuA= X-Received: by 2002:a17:902:f682:b0:198:e056:4d78 with SMTP id l2-20020a170902f68200b00198e0564d78mr3815310plg.23.1676918460844; Mon, 20 Feb 2023 10:41:00 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id jk20-20020a170903331400b0019258bcf3ffsm1911676plb.56.2023.02.20.10.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 10:41:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: thuth@redhat.com, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Ilya Leoshkevich Subject: [PATCH v4 02/27] target/s390x: Use tcg_constant_* for DisasCompare Date: Mon, 20 Feb 2023 08:40:27 -1000 Message-Id: <20230220184052.163465-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230220184052.163465-1-richard.henderson@linaro.org> References: <20230220184052.163465-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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 The a and b fields are not modified by the consumer, and while we need not free a constant, tcg will quietly ignore such frees, so free_compare need not be changed. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 44 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 35e844ef3c..a534419073 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -845,7 +845,7 @@ static void disas_jcc(DisasContext *s, DisasCompare *c, uint32_t mask) c->is_64 = false; c->u.s32.a = tcg_temp_new_i32(); tcg_gen_extrl_i64_i32(c->u.s32.a, cc_dst); - c->u.s32.b = tcg_const_i32(0); + c->u.s32.b = tcg_constant_i32(0); break; case CC_OP_LTGT_32: case CC_OP_LTUGTU_32: @@ -860,7 +860,7 @@ static void disas_jcc(DisasContext *s, DisasCompare *c, uint32_t mask) case CC_OP_NZ: case CC_OP_FLOGR: c->u.s64.a = cc_dst; - c->u.s64.b = tcg_const_i64(0); + c->u.s64.b = tcg_constant_i64(0); c->g1 = true; break; case CC_OP_LTGT_64: @@ -874,14 +874,14 @@ static void disas_jcc(DisasContext *s, DisasCompare *c, uint32_t mask) case CC_OP_TM_64: case CC_OP_ICM: c->u.s64.a = tcg_temp_new_i64(); - c->u.s64.b = tcg_const_i64(0); + c->u.s64.b = tcg_constant_i64(0); tcg_gen_and_i64(c->u.s64.a, cc_src, cc_dst); break; case CC_OP_ADDU: case CC_OP_SUBU: c->is_64 = true; - c->u.s64.b = tcg_const_i64(0); + c->u.s64.b = tcg_constant_i64(0); c->g1 = true; switch (mask) { case 8 | 2: @@ -904,65 +904,65 @@ static void disas_jcc(DisasContext *s, DisasCompare *c, uint32_t mask) switch (mask) { case 0x8 | 0x4 | 0x2: /* cc != 3 */ cond = TCG_COND_NE; - c->u.s32.b = tcg_const_i32(3); + c->u.s32.b = tcg_constant_i32(3); break; case 0x8 | 0x4 | 0x1: /* cc != 2 */ cond = TCG_COND_NE; - c->u.s32.b = tcg_const_i32(2); + c->u.s32.b = tcg_constant_i32(2); break; case 0x8 | 0x2 | 0x1: /* cc != 1 */ cond = TCG_COND_NE; - c->u.s32.b = tcg_const_i32(1); + c->u.s32.b = tcg_constant_i32(1); break; case 0x8 | 0x2: /* cc == 0 || cc == 2 => (cc & 1) == 0 */ cond = TCG_COND_EQ; c->g1 = false; c->u.s32.a = tcg_temp_new_i32(); - c->u.s32.b = tcg_const_i32(0); + c->u.s32.b = tcg_constant_i32(0); tcg_gen_andi_i32(c->u.s32.a, cc_op, 1); break; case 0x8 | 0x4: /* cc < 2 */ cond = TCG_COND_LTU; - c->u.s32.b = tcg_const_i32(2); + c->u.s32.b = tcg_constant_i32(2); break; case 0x8: /* cc == 0 */ cond = TCG_COND_EQ; - c->u.s32.b = tcg_const_i32(0); + c->u.s32.b = tcg_constant_i32(0); break; case 0x4 | 0x2 | 0x1: /* cc != 0 */ cond = TCG_COND_NE; - c->u.s32.b = tcg_const_i32(0); + c->u.s32.b = tcg_constant_i32(0); break; case 0x4 | 0x1: /* cc == 1 || cc == 3 => (cc & 1) != 0 */ cond = TCG_COND_NE; c->g1 = false; c->u.s32.a = tcg_temp_new_i32(); - c->u.s32.b = tcg_const_i32(0); + c->u.s32.b = tcg_constant_i32(0); tcg_gen_andi_i32(c->u.s32.a, cc_op, 1); break; case 0x4: /* cc == 1 */ cond = TCG_COND_EQ; - c->u.s32.b = tcg_const_i32(1); + c->u.s32.b = tcg_constant_i32(1); break; case 0x2 | 0x1: /* cc > 1 */ cond = TCG_COND_GTU; - c->u.s32.b = tcg_const_i32(1); + c->u.s32.b = tcg_constant_i32(1); break; case 0x2: /* cc == 2 */ cond = TCG_COND_EQ; - c->u.s32.b = tcg_const_i32(2); + c->u.s32.b = tcg_constant_i32(2); break; case 0x1: /* cc == 3 */ cond = TCG_COND_EQ; - c->u.s32.b = tcg_const_i32(3); + c->u.s32.b = tcg_constant_i32(3); break; default: /* CC is masked by something else: (8 >> cc) & mask. */ cond = TCG_COND_NE; c->g1 = false; - c->u.s32.a = tcg_const_i32(8); - c->u.s32.b = tcg_const_i32(0); - tcg_gen_shr_i32(c->u.s32.a, c->u.s32.a, cc_op); + c->u.s32.a = tcg_temp_new_i32(); + c->u.s32.b = tcg_constant_i32(0); + tcg_gen_shr_i32(c->u.s32.a, tcg_constant_i32(8), cc_op); tcg_gen_andi_i32(c->u.s32.a, c->u.s32.a, mask); break; } @@ -1619,7 +1619,7 @@ static DisasJumpType op_bct32(DisasContext *s, DisasOps *o) tcg_gen_subi_i64(t, regs[r1], 1); store_reg32_i64(r1, t); c.u.s32.a = tcg_temp_new_i32(); - c.u.s32.b = tcg_const_i32(0); + c.u.s32.b = tcg_constant_i32(0); tcg_gen_extrl_i64_i32(c.u.s32.a, t); tcg_temp_free_i64(t); @@ -1643,7 +1643,7 @@ static DisasJumpType op_bcth(DisasContext *s, DisasOps *o) tcg_gen_subi_i64(t, t, 1); store_reg32h_i64(r1, t); c.u.s32.a = tcg_temp_new_i32(); - c.u.s32.b = tcg_const_i32(0); + c.u.s32.b = tcg_constant_i32(0); tcg_gen_extrl_i64_i32(c.u.s32.a, t); tcg_temp_free_i64(t); @@ -1664,7 +1664,7 @@ static DisasJumpType op_bct64(DisasContext *s, DisasOps *o) tcg_gen_subi_i64(regs[r1], regs[r1], 1); c.u.s64.a = regs[r1]; - c.u.s64.b = tcg_const_i64(0); + c.u.s64.b = tcg_constant_i64(0); return help_branch(s, &c, is_imm, imm, o->in2); }