From nobody Mon Feb 9 06:49:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1498013924718336.1648413285932; Tue, 20 Jun 2017 19:58:44 -0700 (PDT) Received: from localhost ([::1]:51571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNVqt-0006Qi-7q for importer@patchew.org; Tue, 20 Jun 2017 22:58:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNVhO-0006aB-V5 for qemu-devel@nongnu.org; Tue, 20 Jun 2017 22:48:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNVhO-0002Rs-0i for qemu-devel@nongnu.org; Tue, 20 Jun 2017 22:48:55 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:35658) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dNVhN-0002RG-SB for qemu-devel@nongnu.org; Tue, 20 Jun 2017 22:48:53 -0400 Received: by mail-qk0-x241.google.com with SMTP id 16so8296120qkg.2 for ; Tue, 20 Jun 2017 19:48:53 -0700 (PDT) Received: from bigtime.twiddle.net.com (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id l53sm2478939qta.56.2017.06.20.19.48.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 19:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=VFsiWE7qm3LP5NgLRdLxLR0Z1k6LNrvfIzcyXiIC930=; b=YKYXN1BODsqJj8niiwChTsCmKAeLhGrU8HDRJ+IMMcFcKofQ8Y4GdpOSgiSwFttwCS qWNbzqdOZEBVc47tq2jl20ZIgAvQLafV1vPSBV1kpH4L8b/qQHI8DYArmpTpsDZ3YaOV M+m/7k9t92kXbgbMt/Xn7SqOnFWdBIPpLa03+czkXQQxYucjgasx6smz3mCT4bpdJzJe tTpK3olGztz9hrUK8as83lTb14Bh6UoqVzTAhv/1De6dtjEbhxbYX4Oz+ysU3x1QD2/X GWGlKiEWEZ3qMFKue8OfyzgQsmYZAYxNPy1oF3gAj4dgK8us0O4k7eTUDZvzvgFVVOLT onug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=VFsiWE7qm3LP5NgLRdLxLR0Z1k6LNrvfIzcyXiIC930=; b=MWr+JzMRJBf96DxwtVnsQjLclHaaXJtVtmwstoeGsfEa3lRDmgH/nkpoQinES4PY62 rGwq/qYdAlB1Z6O8FIZU5Rivo/dv9KTay8KjPSLy4tOTT4ZSbH9xaknnXdJy07l86Doe 4hQ1mo2e1AvsaXpliNoQn5V0aGddNl8co82yGFEGpGsf92anIvc90qwHeCwkUqN0CmxI VbvNflIiRxfoyahu26KmMfzjMFeEknrCd5a9fOFNhb/h5bMn755F2W9gYW7Pyf94ibVr X9DfO0pNZlIx+KHnnAQsEom8Gisl2/61pq0YevhSn0L8XaPSBXX6fdVq2iE0zr1UIKeK iSDg== X-Gm-Message-State: AKS2vOyQ1WYTKTWqIeoQzbCeA40AHWbXJZYG1RZBZF3tUMCh7M5wr3EG +ZUJudm7IBhpUpdT3Nc= X-Received: by 10.55.8.139 with SMTP id 133mr39277563qki.22.1498013333140; Tue, 20 Jun 2017 19:48:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 20 Jun 2017 19:48:28 -0700 Message-Id: <20170621024831.26019-14-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170621024831.26019-1-rth@twiddle.net> References: <20170621024831.26019-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 13/16] tcg: Export temp_idx X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" At the same time, drop the TCGContext argument and use tcg_ctx instead. Signed-off-by: Richard Henderson --- tcg/tcg.c | 15 ++++----------- tcg/tcg.h | 7 ++++++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index f8d96fa..26931a7 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -473,13 +473,6 @@ void tcg_func_start(TCGContext *s) s->be =3D tcg_malloc(sizeof(TCGBackendData)); } =20 -static inline int temp_idx(TCGContext *s, TCGTemp *ts) -{ - ptrdiff_t n =3D ts - s->temps; - tcg_debug_assert(n >=3D 0 && n < s->nb_temps); - return n; -} - static inline TCGTemp *tcg_temp_alloc(TCGContext *s) { int n =3D s->nb_temps++; @@ -516,7 +509,7 @@ static int tcg_global_reg_new_internal(TCGContext *s, T= CGType type, ts->name =3D name; tcg_regset_set_reg(s->reserved_regs, reg); =20 - return temp_idx(s, ts); + return temp_idx(ts); } =20 void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t siz= e) @@ -605,7 +598,7 @@ int tcg_global_mem_new_internal(TCGType type, TCGv_ptr = base, ts->mem_offset =3D offset; ts->name =3D name; } - return temp_idx(s, ts); + return temp_idx(ts); } =20 static int tcg_temp_new_internal(TCGType type, int temp_local) @@ -645,7 +638,7 @@ static int tcg_temp_new_internal(TCGType type, int temp= _local) ts->temp_allocated =3D 1; ts->temp_local =3D temp_local; } - idx =3D temp_idx(s, ts); + idx =3D temp_idx(ts); } =20 #if defined(CONFIG_DEBUG_TCG) @@ -963,7 +956,7 @@ static void tcg_reg_alloc_start(TCGContext *s) static char *tcg_get_arg_str_ptr(TCGContext *s, char *buf, int buf_size, TCGTemp *ts) { - int idx =3D temp_idx(s, ts); + int idx =3D temp_idx(ts); =20 if (ts->temp_global) { pstrcpy(buf, buf_size, ts->name); diff --git a/tcg/tcg.h b/tcg/tcg.h index 4f69d0c..b75a745 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -733,13 +733,18 @@ struct TCGContext { extern TCGContext tcg_ctx; extern bool parallel_cpus; =20 -static inline TCGArg temp_arg(TCGTemp *ts) +static inline size_t temp_idx(TCGTemp *ts) { ptrdiff_t n =3D ts - tcg_ctx.temps; tcg_debug_assert(n >=3D 0 && n < tcg_ctx.nb_temps); return n; } =20 +static inline TCGArg temp_arg(TCGTemp *ts) +{ + return temp_idx(ts); +} + static inline TCGTemp *arg_temp(TCGArg a) { return a =3D=3D TCG_CALL_DUMMY_ARG ? NULL : &tcg_ctx.temps[a]; --=20 2.9.4