From nobody Tue Oct 28 04:11:07 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1514576025480877.3288690601948; Fri, 29 Dec 2017 11:33:45 -0800 (PST) Received: from localhost ([::1]:51981 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eV0PK-00023t-Id for importer@patchew.org; Fri, 29 Dec 2017 14:33:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eV0NN-0000n5-NT for qemu-devel@nongnu.org; Fri, 29 Dec 2017 14:31:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eV0NI-0000Ho-RG for qemu-devel@nongnu.org; Fri, 29 Dec 2017 14:31:29 -0500 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:35735) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eV0NI-0000GT-K2 for qemu-devel@nongnu.org; Fri, 29 Dec 2017 14:31:24 -0500 Received: by mail-pf0-x241.google.com with SMTP id j124so22438915pfc.2 for ; Fri, 29 Dec 2017 11:31:24 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-183-164.tukw.qwest.net. [97.113.183.164]) by smtp.gmail.com with ESMTPSA id q68sm71240492pfb.1.2017.12.29.11.31.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Dec 2017 11:31:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aj59PuZaZzVRzLWyd3Vc43FIE3Hg1W0rjzAv4vcwhz4=; b=QRcnwpr6iTq1n9ZBu269HR3I2nxszZV4f4g61LKrpIkpF7jWxIvhJc1QMDpIvpI37S nSZzsdRfNj/0kCo83CbhgO+HK1zq5L0OMN1yNHCx1QvPHmJaksir1b+HRJK6nBiatr0w qA+I9yitv4LcfQRkjxPNmplVopUAf4u86FpYM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aj59PuZaZzVRzLWyd3Vc43FIE3Hg1W0rjzAv4vcwhz4=; b=Sk+wfeMPh5yZLdzg+3HMjHZu04OphDGg8UDSQLzU5rwpp6dOQZL03fIcM2tWkKd8k7 fs+pizw5TuzX96ZHJxIvSkLIjP0u3zuvePZ3NBfjUAl8OCzCiTT3y12m1A6fl88acqJo 5dsHDxQ9L92BHc43fc8pfGSQZPQugRh1XeNtKzAt+DKfV926meSNqBhsNrOOyOuFC+pV ewjlhfxoH7ZueGaLYNtTo56teXnQxr7xup06UHnanTGyi8DyDtnSlwbOLugqqZhPLtkE Um91ZIlLWcxeq1zeO8RvUNfMfvSA0k+nt5MQIXQGP35Re4370XA82ihp+Xg/Uh5xUc1F hIkQ== X-Gm-Message-State: AKGB3mJU3tTmwcqgoLLWjYHIr11nZssoKxsApXi8e+0QHGMIZ0Wpg8mZ /Irc2BQHQb/5iU+cJZCK1iUxqC1YY6E= X-Google-Smtp-Source: ACJfBovn+6tiBlQgdkKX8FK4xm5tMcydZB9iLyM8/hG/Fv+rwvhxR+C7yYNnu82wzMQQcQnErCj0Hg== X-Received: by 10.101.86.204 with SMTP id w12mr14482087pgs.70.1514575883157; Fri, 29 Dec 2017 11:31:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 29 Dec 2017 11:31:10 -0800 Message-Id: <20171229193113.11753-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171229193113.11753-1-richard.henderson@linaro.org> References: <20171229193113.11753-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PULL 5/8] tcg: Generalize TCGOp parameters 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: peter.maydell@linaro.org 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_6 Z_629925259 SPT_0 We had two fields specific to INDEX_op_call. Rename these and add some macros so that the fields may be reused for other opcodes. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- tcg/tcg.h | 10 ++++++---- tcg/optimize.c | 4 ++-- tcg/tcg.c | 22 +++++++++++----------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/tcg/tcg.h b/tcg/tcg.h index a577447846..f25efa9795 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -566,10 +566,9 @@ typedef uint16_t TCGLifeData; typedef struct TCGOp { TCGOpcode opc : 8; /* 8 */ =20 - /* The number of out and in parameter for a call. */ - unsigned calli : 4; /* 12 */ - unsigned callo : 2; /* 14 */ - unsigned : 2; /* 16 */ + /* Parameters for this opcode. See below. */ + unsigned param1 : 4; /* 12 */ + unsigned param2 : 4; /* 16 */ =20 /* Lifetime data of the operands. */ unsigned life : 16; /* 32 */ @@ -581,6 +580,9 @@ typedef struct TCGOp { TCGArg args[MAX_OPC_PARAM]; } TCGOp; =20 +#define TCGOP_CALLI(X) (X)->param1 +#define TCGOP_CALLO(X) (X)->param2 + /* Make sure operands fit in the bitfields above. */ QEMU_BUILD_BUG_ON(NB_OPS > (1 << 8)); =20 diff --git a/tcg/optimize.c b/tcg/optimize.c index e495680e95..2cbbeefd53 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -627,8 +627,8 @@ void tcg_optimize(TCGContext *s) /* Count the arguments, and initialize the temps that are going to be used */ if (opc =3D=3D INDEX_op_call) { - nb_oargs =3D op->callo; - nb_iargs =3D op->calli; + nb_oargs =3D TCGOP_CALLO(op); + nb_iargs =3D TCGOP_CALLI(op); for (i =3D 0; i < nb_oargs + nb_iargs; i++) { TCGTemp *ts =3D arg_temp(op->args[i]); if (ts) { diff --git a/tcg/tcg.c b/tcg/tcg.c index f26949a900..93caa0be93 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1430,7 +1430,7 @@ void tcg_gen_callN(void *func, TCGTemp *ret, int narg= s, TCGTemp **args) } else { nb_rets =3D 0; } - op->callo =3D nb_rets; + TCGOP_CALLO(op) =3D nb_rets; =20 real_args =3D 0; for (i =3D 0; i < nargs; i++) { @@ -1469,10 +1469,10 @@ void tcg_gen_callN(void *func, TCGTemp *ret, int na= rgs, TCGTemp **args) } op->args[pi++] =3D (uintptr_t)func; op->args[pi++] =3D flags; - op->calli =3D real_args; + TCGOP_CALLI(op) =3D real_args; =20 /* Make sure the fields didn't overflow. */ - tcg_debug_assert(op->calli =3D=3D real_args); + tcg_debug_assert(TCGOP_CALLI(op) =3D=3D real_args); tcg_debug_assert(pi <=3D ARRAY_SIZE(op->args)); =20 #if defined(__sparc__) && !defined(__arch64__) \ @@ -1634,8 +1634,8 @@ void tcg_dump_ops(TCGContext *s) } } else if (c =3D=3D INDEX_op_call) { /* variable number of arguments */ - nb_oargs =3D op->callo; - nb_iargs =3D op->calli; + nb_oargs =3D TCGOP_CALLO(op); + nb_iargs =3D TCGOP_CALLI(op); nb_cargs =3D def->nb_cargs; =20 /* function name, flags, out args */ @@ -1996,8 +1996,8 @@ static void liveness_pass_1(TCGContext *s) { int call_flags; =20 - nb_oargs =3D op->callo; - nb_iargs =3D op->calli; + nb_oargs =3D TCGOP_CALLO(op); + nb_iargs =3D TCGOP_CALLI(op); call_flags =3D op->args[nb_oargs + nb_iargs + 1]; =20 /* pure functions can be removed if their result is unused= */ @@ -2233,8 +2233,8 @@ static bool liveness_pass_2(TCGContext *s) TCGTemp *arg_ts, *dir_ts; =20 if (opc =3D=3D INDEX_op_call) { - nb_oargs =3D op->callo; - nb_iargs =3D op->calli; + nb_oargs =3D TCGOP_CALLO(op); + nb_iargs =3D TCGOP_CALLI(op); call_flags =3D op->args[nb_oargs + nb_iargs + 1]; } else { nb_iargs =3D def->nb_iargs; @@ -2915,8 +2915,8 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCG= Op *op) =20 static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op) { - const int nb_oargs =3D op->callo; - const int nb_iargs =3D op->calli; + const int nb_oargs =3D TCGOP_CALLO(op); + const int nb_iargs =3D TCGOP_CALLI(op); const TCGLifeData arg_life =3D op->life; int flags, nb_regs, i; TCGReg reg; --=20 2.14.3