From nobody Wed Nov 27 14:43:13 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=1698613800; cv=none; d=zohomail.com; s=zohoarc; b=IUFAswtVUuNqZJAPJ2AD3MXYb3vHzjqlTJp96uPotBSHpbw4oIvCul3az03vTvUybrCfXfTj9EDIJkF109tICh1IyFlSU7NWQXgtJ9Oc8bK7kzM6o88WoknIxaVNCNRyeY92mQCq2CoPoOliugaxO3q/oz4FrGVagrXiXgSw4YA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698613800; h=Content-Transfer-Encoding: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:Cc; bh=yIEZ8p0+QQTNAMNRSoKjZTD6g/pQ7cEjDl2k36Rpcsg=; b=iagEtnAAq4kaKu9Grt1q4fX8/e5ipfkciaV+xN16Hpo0MmpVfOg3CqlQLnLe6gyGBE4PhlOyHFmA0Cxx9NrRjBfI7xDJfTYZvjezoBvYCrq5aMZ2q3mgYKGhgbxlz/zCU0iZmGb2/0F1CG/HDYldAj5WApIHbF5IiBRv9B30TLM= 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 1698613800467711.9699424068117; Sun, 29 Oct 2023 14:10:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxD1m-0002f5-UY; Sun, 29 Oct 2023 17:08:58 -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 1qxD1k-0002eB-Dw for qemu-devel@nongnu.org; Sun, 29 Oct 2023 17:08:56 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qxD1h-0005DT-3O for qemu-devel@nongnu.org; Sun, 29 Oct 2023 17:08:56 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6bee11456baso3188598b3a.1 for ; Sun, 29 Oct 2023 14:08:52 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id z11-20020aa785cb000000b006c0685422e0sm4622847pfn.214.2023.10.29.14.08.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 14:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698613731; x=1699218531; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=yIEZ8p0+QQTNAMNRSoKjZTD6g/pQ7cEjDl2k36Rpcsg=; b=laKdn6vezn+fYpF1UmRR32gwJCXGPVIkUNsDDJbB8w+pAVZYLLkPUIfgFIV3Ar/lRN HCyqiTwNcIhuAgQ7nWbpYB4+ZNFx0qzaHEIDNLGmDTfBU7vefakgicYO1STnB8G5CeF5 0AB5dX5vb2IWA9FtJ6xTyQZa/H+coG62Dy0P2yneah0T9yb6WE9YcKcFtEH5YcRwqtsL sBZhkQO1HO0F5ZSU5nnZ6xFyoQqmsFWayU4UuLvdXUphcx7QH+0vhMJltcCwcxEkCrrk ssRzHGbItFoRnA1mcwMRe3jbVjnRqqy4n08jhIi475xMijMNidlFGF73+8/N5Y6wfoTa G9CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698613731; x=1699218531; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yIEZ8p0+QQTNAMNRSoKjZTD6g/pQ7cEjDl2k36Rpcsg=; b=VQbkrOZ9XmmW9d1FXsJv8VybxWVN4nSXHzIFSXhTK5g2QZ9Mbtj9dgwuN6DAXxa9C6 9xEtMBqbs2FWOb64Ww76S/6eQlsV9wTHoiPkIc0FP5VxNXYAuoN4uaflR63PU4lOfCSp y5j/OArEIHEK1rVud5cQePqII+7eHyBzoNt1sRpR8OGXpY0eL3YkrxR/Pebp4azIH0Hm 83wBIX7l/sUufokOXyOCAdtTkmC6JBSGVsDvebT7auLZEFXIuGkxst+gqegDSgGvK4I1 BQ+EmNBXysFsLfYKWasVv2RbmQctMe16Bkmy1WQ0mihhjF/YPW58UsOiZdVZaLuiyP+7 p1xA== X-Gm-Message-State: AOJu0YxBTiQp6hG7Ub60Wm7Ab7P1ZpUqrGA7TlR+35xOueALdikqD8lG +RXJOaMODnVUxPQvx+b1BjTZ5p4A+I/SkIgZjNs= X-Google-Smtp-Source: AGHT+IHo8I+NDkUaw+ByKOZDPlZ8+0AOkQQeDL+yMN75lV8V7elosBQgsGla+g0N+5PNAwDarAOBrg== X-Received: by 2002:a05:6a00:2296:b0:693:3e55:59b4 with SMTP id f22-20020a056a00229600b006933e5559b4mr7569334pfe.8.1698613731512; Sun, 29 Oct 2023 14:08:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 01/11] tcg: Mark tcg_gen_op* as noinline Date: Sun, 29 Oct 2023 14:08:38 -0700 Message-Id: <20231029210848.78234-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231029210848.78234-1-richard.henderson@linaro.org> References: <20231029210848.78234-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1698613801100100001 Content-Type: text/plain; charset="utf-8" Encourage the compiler to tail-call rather than inline across the dozens of opcode expanders. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tcg/tcg-op.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 828eb9ee46..9aed19e957 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -31,20 +31,26 @@ #include "tcg-internal.h" =20 =20 -void tcg_gen_op1(TCGOpcode opc, TCGArg a1) +/* + * Encourage the compiler to tail-call to a function, rather than inlining. + * Minimizes code size across 99 bottles of beer on the wall. + */ +#define NI __attribute__((noinline)) + +void NI tcg_gen_op1(TCGOpcode opc, TCGArg a1) { TCGOp *op =3D tcg_emit_op(opc, 1); op->args[0] =3D a1; } =20 -void tcg_gen_op2(TCGOpcode opc, TCGArg a1, TCGArg a2) +void NI tcg_gen_op2(TCGOpcode opc, TCGArg a1, TCGArg a2) { TCGOp *op =3D tcg_emit_op(opc, 2); op->args[0] =3D a1; op->args[1] =3D a2; } =20 -void tcg_gen_op3(TCGOpcode opc, TCGArg a1, TCGArg a2, TCGArg a3) +void NI tcg_gen_op3(TCGOpcode opc, TCGArg a1, TCGArg a2, TCGArg a3) { TCGOp *op =3D tcg_emit_op(opc, 3); op->args[0] =3D a1; @@ -52,7 +58,7 @@ void tcg_gen_op3(TCGOpcode opc, TCGArg a1, TCGArg a2, TCG= Arg a3) op->args[2] =3D a3; } =20 -void tcg_gen_op4(TCGOpcode opc, TCGArg a1, TCGArg a2, TCGArg a3, TCGArg a4) +void NI tcg_gen_op4(TCGOpcode opc, TCGArg a1, TCGArg a2, TCGArg a3, TCGArg= a4) { TCGOp *op =3D tcg_emit_op(opc, 4); op->args[0] =3D a1; @@ -61,8 +67,8 @@ void tcg_gen_op4(TCGOpcode opc, TCGArg a1, TCGArg a2, TCG= Arg a3, TCGArg a4) op->args[3] =3D a4; } =20 -void tcg_gen_op5(TCGOpcode opc, TCGArg a1, TCGArg a2, TCGArg a3, - TCGArg a4, TCGArg a5) +void NI tcg_gen_op5(TCGOpcode opc, TCGArg a1, TCGArg a2, TCGArg a3, + TCGArg a4, TCGArg a5) { TCGOp *op =3D tcg_emit_op(opc, 5); op->args[0] =3D a1; @@ -72,8 +78,8 @@ void tcg_gen_op5(TCGOpcode opc, TCGArg a1, TCGArg a2, TCG= Arg a3, op->args[4] =3D a5; } =20 -void tcg_gen_op6(TCGOpcode opc, TCGArg a1, TCGArg a2, TCGArg a3, - TCGArg a4, TCGArg a5, TCGArg a6) +void NI tcg_gen_op6(TCGOpcode opc, TCGArg a1, TCGArg a2, TCGArg a3, + TCGArg a4, TCGArg a5, TCGArg a6) { TCGOp *op =3D tcg_emit_op(opc, 6); op->args[0] =3D a1; --=20 2.34.1