Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2198176/?format=api
{ "id": 2198176, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2198176/?format=api", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/1.0/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<bmm.hfy4c1w8xq.gcc.gcc-TEST.why.135.2.1@forge-stage.sourceware.org>", "date": "2026-02-19T14:02:02", "name": "[v2,1/7,Vectorizer] : SLP MATCH Pattern: Add Internal Functions and Optabs", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "46c9929914e76c9dfe1a04fa5eeed3831d613000", "submitter": { "id": 92460, "url": "http://patchwork.ozlabs.org/api/1.0/people/92460/?format=api", "name": "Andrei Tirziu via Sourceware Forge", "email": "forge-bot+why@forge-stage.sourceware.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hfy4c1w8xq.gcc.gcc-TEST.why.135.2.1@forge-stage.sourceware.org/mbox/", "series": [ { "id": 492684, "url": "http://patchwork.ozlabs.org/api/1.0/series/492684/?format=api", "date": "2026-02-19T14:02:02", "name": "Vectorizer: New SLP Pattern", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/492684/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2198176/checks/", "tags": {}, "headers": { "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org", "sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org", "server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGw7s3RLCz1xvg\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 20 Feb 2026 01:03:05 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 7C7FB4B9DB5F\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 14:03:03 +0000 (GMT)", "from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id CCB774B9DB40\n for <gcc-patches@gcc.gnu.org>; Thu, 19 Feb 2026 14:02:36 +0000 (GMT)", "from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 8B7114422E;\n Thu, 19 Feb 2026 14:02:36 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 7C7FB4B9DB5F", "OpenDKIM Filter v2.11.0 sourceware.org CCB774B9DB40" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org CCB774B9DB40", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org CCB774B9DB40", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771509756; cv=none;\n b=R9BhZX1M9fRuR1YngiNGiX9uOxMwUIYHAaaYOM1kg/C55tUMfLIUvGe4uzmgTBO2p2ry0WuhmyU7M/C0fO6Jc0LAa0FwroHdqj7bsz5mp9kjNJkTAZCfIe/uebd7+AyLHzbCc/JPs+y2doZPdhCL/gXrJHGctdJ2cmKEr1cpxG0=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1771509756; c=relaxed/simple;\n bh=uySvtJYHSTbMOz/2r2IwnEUtYNLa7ezDYvzjTRx9zpU=;\n h=From:Date:Subject:To:Message-ID;\n b=jR1PtuLU8K3BUX5PKtiMqgLuHpO24Na4MhVy0nk+ahhvd/lIhC52Qw1ctJyp5VBysCtbVKRItztFczg/inFR2/d2LFVtTk6C9g2R3TcEmuiLwG4UdhaZlmJ08IH5dBK+23OB5gmc24kt54zFjCT0nkVdC9Bdt/LBosTVDS4gnxc=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "From": "Andrei Tirziu via Sourceware Forge\n <forge-bot+why@forge-stage.sourceware.org>", "Date": "Thu, 19 Feb 2026 14:02:02 +0000", "Subject": "[PATCH v2 1/7] [Vectorizer]: SLP MATCH Pattern: Add Internal\n Functions and Optabs", "To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>", "Cc": "Tamar Christina <tamar.christina@arm.com>,\n Victor Do Nascimento <victor.donascimento@arm.com>", "Message-ID": "\n <bmm.hfy4c1w8xq.gcc.gcc-TEST.why.135.2.1@forge-stage.sourceware.org>", "X-Mailer": "batrachomyomachia", "X-Pull-Request-Organization": "gcc", "X-Pull-Request-Repository": "gcc-TEST", "X-Pull-Request": "https://forge.sourceware.org/gcc/gcc-TEST/pulls/135", "References": "\n <bmm.hfy4c1w8xq.gcc.gcc-TEST.why.135.2.0@forge-stage.sourceware.org>", "In-Reply-To": "\n <bmm.hfy4c1w8xq.gcc.gcc-TEST.why.135.2.0@forge-stage.sourceware.org>", "X-Patch-URL": "\n https://forge.sourceware.org/why/gcc/commit/38a9e7b1b9c063674e7207117c93b11f195975e9", "X-BeenThere": "gcc-patches@gcc.gnu.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>", "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>", "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>", "Reply-To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>,\n Tamar Christina <tamar.christina@arm.com>,\n Victor Do Nascimento <victor.donascimento@arm.com>,\n andreinichita.tirziu@arm.com", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "From: Andrei Nichita Tirziu <andreinichita.tirziu@arm.com>\n\nThe MATCH Pattern is a new addition to the vectorizer.\nAfter the pattern is identified, a replacement node\nis created for the initial expression.\n\nThis requires several new Internal Functions:\n - `IFN_MATCH_ANY_FROM`, `IFN_MATCH_NONE_FROM`: the basic IFNs for\n unpredicated `match / nmatch` instructions.\n These are used when building the new node, but are expected to\n get transformed into the conditional versions.\n - `IFN_COND_MATCH_ANY_FROM`, `IFN_COND_MATCH_NONE_FROM`: conditional versions.\n - `IFN_COND_LEN_MATCH_ANY_FROM`, `IFN_COND_LEN_MATCH_NONE_FROM`: conditional\n with length versions.\n\nThe arguments of these functions are:\n - `IFN_MATCH_ANY_FROM (variants, invariants)`\n - `IFN_MATCH_NONE_FROM (variants, invariants)`\n - `IFN_COND_MATCH_ANY_FROM (variants, invariants, mask, else)`\n - `IFN_COND_MATCH_NONE_FROM (variants, invariants, mask, else)`\n - `IFN_COND_LEN_MATCH_ANY_FROM (variants, invariants, mask, else, len, bias)`\n - `IFN_COND_LEN_MATCH_NONE_FROM (variants, invariants, mask, else, len, bias)`\n\nThese IFNs have corresponding optabs. It is up to the backends to support\nthem further. All the optabs are declared as \"direct\" optabs,\nsince only a mode is being used. It is expected that the mode\ncorresponds to the input vectors (the variants / invariants).\n\ngcc/ChangeLog:\n\n\t* internal-fn.def: New IFNs for MATCH ANY FROM and MATCH\n\t\t\t NONE FROM (including conditional versions).\n\t* internal-fn.cc: Define paramater positions for new IFNs.\n\t* optabs.def: New optabs for MATCH ANY FROM and MATCH\n\t\t NONE FROM (including conditional versions).\n---\n gcc/doc/md.texi | 18 ++++++++++++++++++\n gcc/internal-fn.cc | 18 +++++++++++++++++-\n gcc/internal-fn.def | 11 +++++++++++\n gcc/optabs.def | 6 ++++++\n 4 files changed, 52 insertions(+), 1 deletion(-)", "diff": "diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi\nindex edbdb1d50f1a..992fb3edfc49 100644\n--- a/gcc/doc/md.texi\n+++ b/gcc/doc/md.texi\n@@ -6144,6 +6144,24 @@ with mode @var{m}.\n \n These instructions are not allowed to @code{FAIL}.\n \n+@cindex @code{vec_match_any_from_@var{m}} instruction pattern\n+@cindex @code{vec_match_none_from_@var{m}} instruction pattern\n+@cindex @code{cond_vec_match_any_from_@var{m}} instruction pattern\n+@cindex @code{cond_vec_match_none_from_@var{m}} instruction pattern\n+@cindex @code{cond_len_vec_match_any_from_@var{m}} instruction pattern\n+@cindex @code{cond_len_vec_match_none_from_@var{m}} instruction pattern\n+@item @samp{vec_match_any_from_@var{m}}, @samp{cond_vec_match_any_from_@var{m}}, @samp{cond_len_vec_match_any_from_@var{m}}\n+@itemx @samp{vec_match_none_from_@var{m}}, @samp{cond_vec_match_none_from_@var{m}}, @samp{cond_len_vec_match_none_from_@var{m}}\n+Used for Match ANY FROM and Match NONE FROM patterns, which handle\n+disjunctions of equality comparisons and conjunctions of inequality comparisons.\n+\n+@smallexample\n+short int a[1000], x, y, z, sum = 0;\n+for (int i = 0; i < 1000; i++)\n+ if (a[i] == x || a[i] == y || a[i] == z)\n+ sum++;\n+@end smallexample\n+\n @cindex @code{mulhisi3} instruction pattern\n @item @samp{mulhisi3}\n Multiply operands 1 and 2, which have mode @code{HImode}, and store\ndiff --git a/gcc/internal-fn.cc b/gcc/internal-fn.cc\nindex d879568c6e3e..f81d147c3830 100644\n--- a/gcc/internal-fn.cc\n+++ b/gcc/internal-fn.cc\n@@ -4834,7 +4834,9 @@ get_conditional_len_internal_fn (tree_code code)\n T (ROUND) \\\n T (FLOOR) \\\n T (RINT) \\\n- T (CEIL)\n+ T (CEIL) \\\n+ T (MATCH_ANY_FROM) \\\n+ T (MATCH_NONE_FROM)\n \n /* Return a function that only performs internal function FN when a\n certain condition is met and that uses a given fallback value otherwise.\n@@ -4890,6 +4892,10 @@ get_len_internal_fn (internal_fn fn)\n return IFN_MASK_LEN_LOAD_LANES;\n case IFN_MASK_GATHER_LOAD:\n return IFN_MASK_LEN_GATHER_LOAD;\n+ case IFN_MATCH_ANY_FROM:\n+ return IFN_COND_LEN_MATCH_ANY_FROM;\n+ case IFN_MATCH_NONE_FROM:\n+ return IFN_COND_LEN_MATCH_NONE_FROM;\n default:\n return IFN_LAST;\n }\n@@ -5106,6 +5112,8 @@ internal_fn_len_index (internal_fn fn)\n case IFN_COND_LEN_XOR:\n case IFN_COND_LEN_SHL:\n case IFN_COND_LEN_SHR:\n+ case IFN_COND_LEN_MATCH_ANY_FROM:\n+ case IFN_COND_LEN_MATCH_NONE_FROM:\n case IFN_MASK_LEN_STRIDED_STORE:\n return 4;\n \n@@ -5179,6 +5187,10 @@ internal_fn_else_index (internal_fn fn)\n case IFN_COND_LEN_XOR:\n case IFN_COND_LEN_SHL:\n case IFN_COND_LEN_SHR:\n+ case IFN_COND_MATCH_ANY_FROM:\n+ case IFN_COND_MATCH_NONE_FROM:\n+ case IFN_COND_LEN_MATCH_ANY_FROM:\n+ case IFN_COND_LEN_MATCH_NONE_FROM:\n return 3;\n \n case IFN_MASK_LOAD:\n@@ -5225,6 +5237,10 @@ internal_fn_mask_index (internal_fn fn)\n case IFN_MASK_LEN_STORE_LANES:\n case IFN_MASK_LEN_LOAD:\n case IFN_MASK_LEN_STORE:\n+ case IFN_COND_MATCH_ANY_FROM:\n+ case IFN_COND_MATCH_NONE_FROM:\n+ case IFN_COND_LEN_MATCH_ANY_FROM:\n+ case IFN_COND_LEN_MATCH_NONE_FROM:\n return 2;\n \n case IFN_MASK_LEN_STRIDED_LOAD:\ndiff --git a/gcc/internal-fn.def b/gcc/internal-fn.def\nindex 084a92716312..131328d29c1a 100644\n--- a/gcc/internal-fn.def\n+++ b/gcc/internal-fn.def\n@@ -246,6 +246,17 @@ DEF_INTERNAL_OPTAB_FN (VEC_SET, ECF_CONST | ECF_NOTHROW, vec_set, vec_set)\n DEF_INTERNAL_OPTAB_FN (VEC_EXTRACT, ECF_CONST | ECF_NOTHROW,\n \t\t vec_extract, vec_extract)\n \n+// Internal functions for Match ANY FROM and Match NONE FROM patterns\n+// (conjuction of inequalities or disjunction of equalities)\n+DEF_INTERNAL_OPTAB_FN (MATCH_ANY_FROM, ECF_PURE | ECF_NOTHROW,\n+\t\t vec_match_any_from, binary)\n+DEF_INTERNAL_OPTAB_FN (MATCH_NONE_FROM, ECF_PURE | ECF_NOTHROW,\n+\t\t vec_match_none_from, binary)\n+DEF_INTERNAL_COND_FN (MATCH_ANY_FROM, ECF_PURE | ECF_NOTHROW,\n+\t\t vec_match_any_from, binary)\n+DEF_INTERNAL_COND_FN (MATCH_NONE_FROM, ECF_PURE | ECF_NOTHROW,\n+\t\t vec_match_none_from, binary)\n+\n DEF_INTERNAL_OPTAB_FN (LEN_STORE, 0, len_store, len_store)\n DEF_INTERNAL_OPTAB_FN (MASK_LEN_STORE, 0, mask_len_store, mask_len_store)\n \ndiff --git a/gcc/optabs.def b/gcc/optabs.def\nindex 193f42a728a2..41932fc54ecd 100644\n--- a/gcc/optabs.def\n+++ b/gcc/optabs.def\n@@ -517,6 +517,12 @@ OPTAB_D (vec_trunc_add_high_optab, \"vec_trunc_add_high$a\")\n OPTAB_D (vec_addsub_optab, \"vec_addsub$a3\")\n OPTAB_D (vec_fmaddsub_optab, \"vec_fmaddsub$a4\")\n OPTAB_D (vec_fmsubadd_optab, \"vec_fmsubadd$a4\")\n+OPTAB_D (vec_match_any_from_optab, \"vec_match_any_from_$a\")\n+OPTAB_D (vec_match_none_from_optab, \"vec_match_none_from_$a\")\n+OPTAB_D (cond_vec_match_any_from_optab, \"vec_match_any_from_cond_$a\")\n+OPTAB_D (cond_vec_match_none_from_optab, \"vec_match_none_from_cond_$a\")\n+OPTAB_D (cond_len_vec_match_any_from_optab, \"vec_match_any_from_cond_len_$a\")\n+OPTAB_D (cond_len_vec_match_none_from_optab, \"vec_match_none_from_cond_len_$a\")\n \n OPTAB_D (sync_add_optab, \"sync_add$I$a\")\n OPTAB_D (sync_and_optab, \"sync_and$I$a\")\n", "prefixes": [ "v2", "1/7", "Vectorizer" ] }