From nobody Thu Nov 14 07:03:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704926870; cv=none; d=zohomail.com; s=zohoarc; b=R5eEe8ZCv9jLi9F806/UIlKXEBkh7GPOH77XHSpIJe5Ql5xqPW6d5AzKHvTbudiYv6F7gfm6S/AlVwQ4CotBIm0WfX/d9YNdVTaqu5Y70x5IEOgysirqRe6062/eC1PK1RIGVw/5JX1xe6lx2Q65yBcLlVYLM0mGPCVOB0MSuqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704926870; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Njou8078FZIGaih/KmoVshAEm+KpvJ/TDJRnizv9npg=; b=nDG2a+Q75dEXeO7oWtuFNoeoT2ZiF7nX9rl4X11RN9+5Jadah0wwRzip2NUUi6yRkvDXLhkwF5LGMOZqmp5SxZzo0pEFeXK8xS0K84264mTyH813taXPkum+iPZXcoQXUJwMlZy4897MSo/1pTq1FpYGYVFWdIRJQ90xmIVxH9c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170492687024191.08956462196181; Wed, 10 Jan 2024 14:47:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNhLV-0008Sn-JM; Wed, 10 Jan 2024 17:46:49 -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 1rNhLL-0007UC-Jh for qemu-devel@nongnu.org; Wed, 10 Jan 2024 17:46:39 -0500 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNhLJ-0003Yj-K9 for qemu-devel@nongnu.org; Wed, 10 Jan 2024 17:46:39 -0500 Received: by mail-qt1-x834.google.com with SMTP id d75a77b69052e-427f21ced6aso30334331cf.1 for ; Wed, 10 Jan 2024 14:46:37 -0800 (PST) Received: from stoup.. ([172.58.27.160]) by smtp.gmail.com with ESMTPSA id ks23-20020ac86217000000b0042987f6874bsm2092281qtb.92.2024.01.10.14.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 14:46:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704926796; x=1705531596; 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=Njou8078FZIGaih/KmoVshAEm+KpvJ/TDJRnizv9npg=; b=laCXAx+1wcStctR2BZGWoWFTvb8aRcK6iSGCh0GIL6BhcG6k1PWpMwBvj8OYp1LVWF /S/QatoEU/tCrNtOl/oVm245XqvS64shICZc1ibOeRfztHNW5P3L475J2l/uDU7OBh24 3x6qBo5pqIBfxThrRXMS8o8XxQ+vzoakNlZhJhFILU6itzqwmVbHjMVeYdTJjB5aMHVt wBB6D1+RL/jgEms/tm5SPR1vz2IT6W3ZGIAgFFIu/bBSPWgoSOlw37j7NZNPd697I2Ox /Xd01KL0fNIdAQlrJLRsgz66lYLjyJBBOvEaU75qEYH9R2IlKv4XCOmJlnxYwNffzYcE OwOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704926796; x=1705531596; 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=Njou8078FZIGaih/KmoVshAEm+KpvJ/TDJRnizv9npg=; b=Fl/PreJ7mFulk1aBpRgkWmhhlTrioXYn7W5lchVQBCdwoewbF+sItXxG/QTDAiM8cv ZYU0uma5hPevMrBgeE2geB9vplVEMApGO+y87lqpdOwYb9ii/rYmiWP4HlI3KxBNUCVs e0+fKGOYvQfhpUfOkxUwbDX8oma5CsE65W5zFAlNpOX5SkIx74suRwmvbO5wpEnEaJtZ 8zL16vEzQkgEPlY/UUajH30w5p6xETT/HFzvDBfCqrbPQqVd7PVCHpZYmEbjdD0zYcgN 7usNrWPjhjJi7jOEBhn05C2ZtaxDEnotXyhsZ37rPnsemq5A1S+sHegMCHo0Ctr2Ehql S88Q== X-Gm-Message-State: AOJu0YwDRNkSInQ9wHrTsRb1joAm7A47AJ1/EO8aYB4QPpetldKXfY8g jkmJQbINFh7gS8C7ELfPB7vK24wFy2AtspvSKt/8/xx+fYGFHVKw X-Google-Smtp-Source: AGHT+IH/vbNkhNkcXSVbcdqyJCV86Lhy2wF083Drgw9gWIkWGLtnJKUQwcoBbMQyXQPWX0Xl1o0rWA== X-Received: by 2002:a05:622a:3c9:b0:429:7f89:4868 with SMTP id k9-20020a05622a03c900b004297f894868mr293924qtx.65.1704926796708; Wed, 10 Jan 2024 14:46:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org, pbonzini@redhat.com Subject: [PATCH v3 30/38] tcg/ppc: Sink tcg_to_bc usage into tcg_out_bc Date: Thu, 11 Jan 2024 09:44:00 +1100 Message-Id: <20240110224408.10444-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240110224408.10444-1-richard.henderson@linaro.org> References: <20240110224408.10444-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::834; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x834.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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704926871473100008 Rename the current tcg_out_bc function to tcg_out_bc_lab, and create a new function that takes an integer displacement + link. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 850ace98b2..830d2fe73a 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -1946,14 +1946,20 @@ static void tcg_out_setcond(TCGContext *s, TCGType = type, TCGCond cond, } } =20 -static void tcg_out_bc(TCGContext *s, int bc, TCGLabel *l) +static void tcg_out_bc(TCGContext *s, TCGCond cond, int bd) { + tcg_out32(s, tcg_to_bc[cond] | bd); +} + +static void tcg_out_bc_lab(TCGContext *s, TCGCond cond, TCGLabel *l) +{ + int bd =3D 0; if (l->has_value) { - bc |=3D reloc_pc14_val(tcg_splitwx_to_rx(s->code_ptr), l->u.value_= ptr); + bd =3D reloc_pc14_val(tcg_splitwx_to_rx(s->code_ptr), l->u.value_p= tr); } else { tcg_out_reloc(s, s->code_ptr, R_PPC_REL14, l, 0); } - tcg_out32(s, bc); + tcg_out_bc(s, cond, bd); } =20 static void tcg_out_brcond(TCGContext *s, TCGCond cond, @@ -1961,7 +1967,7 @@ static void tcg_out_brcond(TCGContext *s, TCGCond con= d, TCGLabel *l, TCGType type) { tcg_out_cmp(s, cond, arg1, arg2, const_arg2, 7, type); - tcg_out_bc(s, tcg_to_bc[cond], l); + tcg_out_bc_lab(s, cond, l); } =20 static void tcg_out_movcond(TCGContext *s, TCGType type, TCGCond cond, @@ -2003,7 +2009,7 @@ static void tcg_out_movcond(TCGContext *s, TCGType ty= pe, TCGCond cond, } } /* Branch forward over one insn */ - tcg_out32(s, tcg_to_bc[cond] | 8); + tcg_out_bc(s, cond, 8); if (v2 =3D=3D 0) { tcg_out_movi(s, type, dest, 0); } else { @@ -2024,11 +2030,11 @@ static void tcg_out_cntxz(TCGContext *s, TCGType ty= pe, uint32_t opc, tcg_out32(s, opc | RA(TCG_REG_R0) | RS(a1)); tcg_out32(s, tcg_to_isel[TCG_COND_EQ] | TAB(a0, a2, TCG_REG_R0= )); } else if (!const_a2 && a0 =3D=3D a2) { - tcg_out32(s, tcg_to_bc[TCG_COND_EQ] | 8); + tcg_out_bc(s, TCG_COND_EQ, 8); tcg_out32(s, opc | RA(a0) | RS(a1)); } else { tcg_out32(s, opc | RA(a0) | RS(a1)); - tcg_out32(s, tcg_to_bc[TCG_COND_NE] | 8); + tcg_out_bc(s, TCG_COND_NE, 8); if (const_a2) { tcg_out_movi(s, type, a0, 0); } else { @@ -2108,11 +2114,11 @@ static void tcg_out_setcond2(TCGContext *s, const T= CGArg *args, tcg_out_rlw(s, RLWINM, args[0], TCG_REG_R0, 31, 31, 31); } =20 -static void tcg_out_brcond2 (TCGContext *s, const TCGArg *args, - const int *const_args) +static void tcg_out_brcond2(TCGContext *s, const TCGArg *args, + const int *const_args) { tcg_out_cmp2(s, args, const_args); - tcg_out_bc(s, BC | BI(7, CR_EQ) | BO_COND_TRUE, arg_label(args[5])); + tcg_out_bc_lab(s, TCG_COND_EQ, arg_label(args[5])); } =20 static void tcg_out_mb(TCGContext *s, TCGArg a0) @@ -2446,7 +2452,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext= *s, HostAddress *h, =20 /* Load a pointer into the current opcode w/conditional branch-lin= k. */ ldst->label_ptr[0] =3D s->code_ptr; - tcg_out32(s, BC | BI(7, CR_EQ) | BO_COND_FALSE | LK); + tcg_out_bc(s, TCG_COND_NE, LK); =20 h->base =3D TCG_REG_TMP1; } else { --=20 2.34.1