From nobody Sun Jun 2 06:40:47 2024 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail header.i=@quicinc.com; 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=fail(p=none dis=none) header.from=quicinc.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158094260016616.449278658815615; Wed, 5 Feb 2020 14:43:20 -0800 (PST) Received: from localhost ([::1]:57868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izTOA-00080e-Q9 for importer@patchew.org; Wed, 05 Feb 2020 17:43:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56801) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izTNQ-0007A9-4n for qemu-devel@nongnu.org; Wed, 05 Feb 2020 17:42:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izTNO-0007yX-LB for qemu-devel@nongnu.org; Wed, 05 Feb 2020 17:42:31 -0500 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:51603) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izTNO-0007en-AS for qemu-devel@nongnu.org; Wed, 05 Feb 2020 17:42:30 -0500 Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-02.qualcomm.com with ESMTP; 05 Feb 2020 14:42:27 -0800 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg03-sd.qualcomm.com with ESMTP; 05 Feb 2020 14:42:27 -0800 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id A9A87B4D; Wed, 5 Feb 2020 16:42:26 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1580942550; x=1612478550; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=1nIkVSKYZdj95UxlxIfwKbiLoTM4iCuAfng4IMBPWjY=; b=YZUFu2UYDLcVotGIr4Kof49Cog4d8iBXAniNzgIX9gH7E2/ZmAFGBnyN 52s4o6ffyySH5M9+KjLX7KZCtYQIH6TanFCA14CgBhH1Fqonfrct7Fg/x UXlYWsVOoggeJbQK70plgwWvbiZgEQhZwO9O+zdZe94OnvI1tU23i6j+d g=; From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [PATCH] Add support for a helper with 7 arguments Date: Wed, 5 Feb 2020 16:41:50 -0600 Message-Id: <1580942510-2820-1-git-send-email-tsimpson@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 199.106.114.39 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Taylor Simpson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Currently, helpers can only take up to 6 arguments. This patch adds the capability for up to 7 arguments. I have tested it with the Hexagon port that I am preparing for submission. Signed-off-by: Taylor Simpson --- include/exec/helper-gen.h | 13 +++++++++++++ include/exec/helper-head.h | 2 ++ include/exec/helper-proto.h | 6 ++++++ include/exec/helper-tcg.h | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/include/exec/helper-gen.h b/include/exec/helper-gen.h index 236ff40..29c02f8 100644 --- a/include/exec/helper-gen.h +++ b/include/exec/helper-gen.h @@ -66,6 +66,18 @@ static inline void glue(gen_helper_, name)(dh_retvar_dec= l(ret) \ tcg_gen_callN(HELPER(name), dh_retvar(ret), 6, args); \ } =20 +#define DEF_HELPER_FLAGS_7(name, flags, ret, t1, t2, t3, t4, t5, t6, t7)\ +static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \ + dh_arg_decl(t1, 1), dh_arg_decl(t2, 2), dh_arg_decl(t3, 3), \ + dh_arg_decl(t4, 4), dh_arg_decl(t5, 5), dh_arg_decl(t6, 6), \ + dh_arg_decl(t7, 7)) \ +{ \ + TCGTemp *args[7] =3D { dh_arg(t1, 1), dh_arg(t2, 2), dh_arg(t3, 3), \ + dh_arg(t4, 4), dh_arg(t5, 5), dh_arg(t6, 6), \ + dh_arg(t7, 7) }; \ + tcg_gen_callN(HELPER(name), dh_retvar(ret), 7, args); \ +} + #include "helper.h" #include "trace/generated-helpers.h" #include "trace/generated-helpers-wrappers.h" @@ -79,6 +91,7 @@ static inline void glue(gen_helper_, name)(dh_retvar_decl= (ret) \ #undef DEF_HELPER_FLAGS_4 #undef DEF_HELPER_FLAGS_5 #undef DEF_HELPER_FLAGS_6 +#undef DEF_HELPER_FLAGS_7 #undef GEN_HELPER =20 #endif /* HELPER_GEN_H */ diff --git a/include/exec/helper-head.h b/include/exec/helper-head.h index f2519c9..3094c79 100644 --- a/include/exec/helper-head.h +++ b/include/exec/helper-head.h @@ -148,6 +148,8 @@ DEF_HELPER_FLAGS_5(name, 0, ret, t1, t2, t3, t4, t5) #define DEF_HELPER_6(name, ret, t1, t2, t3, t4, t5, t6) \ DEF_HELPER_FLAGS_6(name, 0, ret, t1, t2, t3, t4, t5, t6) +#define DEF_HELPER_7(name, ret, t1, t2, t3, t4, t5, t6, t7) \ + DEF_HELPER_FLAGS_7(name, 0, ret, t1, t2, t3, t4, t5, t6, t7) =20 /* MAX_OPC_PARAM_IARGS must be set to n if last entry is DEF_HELPER_FLAGS_= n. */ =20 diff --git a/include/exec/helper-proto.h b/include/exec/helper-proto.h index 1c4ba9b..a0a8d9a 100644 --- a/include/exec/helper-proto.h +++ b/include/exec/helper-proto.h @@ -30,6 +30,11 @@ dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), = dh_ctype(t3), \ dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ dh_ctype(t4), dh_ctype(t5), dh_ctype(t6)); =20 +#define DEF_HELPER_FLAGS_7(name, flags, ret, t1, t2, t3, t4, t5, t6, t7) \ +dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ + dh_ctype(t4), dh_ctype(t5), dh_ctype(t6), \ + dh_ctype(t7)); + #include "helper.h" #include "trace/generated-helpers.h" #include "tcg-runtime.h" @@ -42,5 +47,6 @@ dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), d= h_ctype(t3), \ #undef DEF_HELPER_FLAGS_4 #undef DEF_HELPER_FLAGS_5 #undef DEF_HELPER_FLAGS_6 +#undef DEF_HELPER_FLAGS_7 =20 #endif /* HELPER_PROTO_H */ diff --git a/include/exec/helper-tcg.h b/include/exec/helper-tcg.h index 573c2ce..2787050 100644 --- a/include/exec/helper-tcg.h +++ b/include/exec/helper-tcg.h @@ -52,6 +52,12 @@ | dh_sizemask(t2, 2) | dh_sizemask(t3, 3) | dh_sizemask(t4, 4) \ | dh_sizemask(t5, 5) | dh_sizemask(t6, 6) }, =20 +#define DEF_HELPER_FLAGS_7(NAME, FLAGS, ret, t1, t2, t3, t4, t5, t6, t7) \ + { .func =3D HELPER(NAME), .name =3D str(NAME), .flags =3D FLAGS, \ + .sizemask =3D dh_sizemask(ret, 0) | dh_sizemask(t1, 1) \ + | dh_sizemask(t2, 2) | dh_sizemask(t3, 3) | dh_sizemask(t4, 4) \ + | dh_sizemask(t5, 5) | dh_sizemask(t6, 6) | dh_sizemask(t7, 7) }, + #include "helper.h" #include "trace/generated-helpers.h" #include "tcg-runtime.h" @@ -65,5 +71,6 @@ #undef DEF_HELPER_FLAGS_4 #undef DEF_HELPER_FLAGS_5 #undef DEF_HELPER_FLAGS_6 +#undef DEF_HELPER_FLAGS_7 =20 #endif /* HELPER_TCG_H */ --=20 2.7.4