Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2217508/?format=api
{ "id": 2217508, "url": "http://patchwork.ozlabs.org/api/patches/2217508/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260329231754.2325557-4-vineet.gupta@linux.dev/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/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, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260329231754.2325557-4-vineet.gupta@linux.dev>", "list_archive_url": null, "date": "2026-03-29T23:17:54", "name": "[3/3] bpf: PROMOTE_MODE to SI not DI [PR124419] [do-not-merge]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "8d37d30b60c2a0df1e3a467b1374795d850a5664", "submitter": { "id": 82303, "url": "http://patchwork.ozlabs.org/api/people/82303/?format=api", "name": "Vineet Gupta", "email": "vineet.gupta@linux.dev" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260329231754.2325557-4-vineet.gupta@linux.dev/mbox/", "series": [ { "id": 497942, "url": "http://patchwork.ozlabs.org/api/series/497942/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=497942", "date": "2026-03-29T23:17:51", "name": "bpf: Enable wN reg codegen for bug-fix and fun", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497942/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2217508/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2217508/checks/", "tags": {}, "related": [], "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\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256\n header.s=key1 header.b=VykG6mdG;\n\tdkim-atps=neutral", "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;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256\n header.s=key1 header.b=VykG6mdG", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=linux.dev", "sourceware.org; spf=pass smtp.mailfrom=linux.dev", "server2.sourceware.org;\n arc=none smtp.remote-ip=95.215.58.180" ], "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 4fkVj865vrz1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 10:20:12 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id EB7454B9DB46\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 29 Mar 2026 23:20:04 +0000 (GMT)", "from out-180.mta1.migadu.com (out-180.mta1.migadu.com\n [95.215.58.180])\n by sourceware.org (Postfix) with ESMTPS id 72B9C4BA23ED;\n Sun, 29 Mar 2026 23:18:22 +0000 (GMT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org EB7454B9DB46", "OpenDKIM Filter v2.11.0 sourceware.org 72B9C4BA23ED" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 72B9C4BA23ED", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 72B9C4BA23ED", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774826302; cv=none;\n b=omcqYb6CXbkxQKA0sEvZGydix+pmSiHPt6noUGNrvsF/J7kOEZgCULWKyPsupl+OvtRsq7TMAF4ZZdbOOhuUmA5+L8zxPDjEF0QaKKaMf0aKVe/Yp8IJCtZiAvtLxvNnEujpODmCUCOzEf4dHvQZvijfwg0f2FtfWgHWhCM5ihc=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774826302; c=relaxed/simple;\n bh=CnGN7JwJ7kbAxmAgacauVbnco4sGpvlvvIjkoRzWM/A=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=E1T/I83GuU2wGAE1IuZWiioBecoKcf2f0S3Dc1dlxf+01e1KXY4greVp/5wdMToX6SGFAPofJimh1ZdwghgRrCaoNnQQ0mwmaL5su7fFQ2bdQ3Ndi0IUl4AU5F94KhptHuenaBl0ZgAGhgddF8PZyrd8m8sxxvcrW75U0ntn47U=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "X-Report-Abuse": "Please report any abuse attempt to abuse@migadu.com and\n include these headers.", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;\n t=1774826300;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=e65kqNr8I+VQUVC14KzLrcdGGFM0Aoun3ZbxrXaN9fw=;\n b=VykG6mdGt/PPqoMWpqgnfRF3OmvlLu7tuUGaQ0yEw4KAX+rC8BU1id2jgyBbab7m4XaTmI\n fZwlZ90qqkf4E3IYi3ejsSumm3I6ey6ySSWkqqMqP+PQtIKRa4wedOkzdIEmLMJXqeWBXx\n 56GRk7cPbrDcUqpW6fVlUjH/ndoyOyc=", "From": "Vineet Gupta <vineet.gupta@linux.dev>", "To": "bpf@gcc.gnu.org", "Cc": "gcc-patches@gcc.gnu.org, jose.marchesi@oracle.com, ast@kernel.org,\n Eduard Zingerman <eddyz87@gmail.com>,\n Yonghong Song <yonghong.song@linux.dev>,\n Vineet Gupta <vineet.gupta@linux.dev>", "Subject": "[PATCH 3/3] bpf: PROMOTE_MODE to SI not DI [PR124419] [do-not-merge]", "Date": "Sun, 29 Mar 2026 16:17:54 -0700", "Message-ID": "<20260329231754.2325557-4-vineet.gupta@linux.dev>", "In-Reply-To": "<20260329231754.2325557-1-vineet.gupta@linux.dev>", "References": "<20260329231754.2325557-1-vineet.gupta@linux.dev>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Migadu-Flow": "FLOW_OUT", "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>", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "Since BPF ISA allows 32-bit ops and extensions, smaller types can be\nsafely promoted to SImode (vs. DImode), thus following\n\n- M = DImode; \\\n+ M = SImode;\n\nAlso it is desirable to keep SImode regs as is, thus promotion only\nneeds to be done for sub SImode values (vs. DImode), thus following\n\n- && GET_MODE_SIZE (M) < 8) \\\n+ && GET_MODE_SIZE (M) < 4) \\\n\nThis helps generate more wN regs. This is also part of the ABI change to\nbe addressed in PR/124171.\n\nHowever currently this causes additional selftest failures which I'm\ninvestigating, but figured I'll send it with the rest of the series on\nsame theme.\n\n\tPR target/124419\n\ngcc/ChangeLog:\n\n\t* config/bpf/bpf.h (PROMOTE_MODE): Promote modes smaller than\n\tSImode to SImode.\n\ngcc/testsuite/ChangeLog:\n\n\t* gcc.target/bpf/btfext-lineinfo.c: Adjust for codegen changes.\n\nSigned-off-by: Vineet Gupta <vineet.gupta@linux.dev>\n---\n gcc/config/bpf/bpf.h | 7 +++----\n gcc/testsuite/gcc.target/bpf/btfext-lineinfo.c | 8 ++++----\n 2 files changed, 7 insertions(+), 8 deletions(-)", "diff": "diff --git a/gcc/config/bpf/bpf.h b/gcc/config/bpf/bpf.h\nindex c8dad55fd4c4..32730628febe 100644\n--- a/gcc/config/bpf/bpf.h\n+++ b/gcc/config/bpf/bpf.h\n@@ -43,14 +43,13 @@\n #define BITS_PER_WORD 64\n #define UNITS_PER_WORD 8\n \n-/* When storing an integer whose size is less than 64-bit in a\n- register, promote it to a DImode. */\n+/* Promote integer modes smaller than a word to SImode. */\n #define PROMOTE_MODE(M, UNSIGNEDP, TYPE)\t\\\n do\t\t\t\t\t\t\\\n {\t\t\t\t\t\t\\\n if (GET_MODE_CLASS (M) == MODE_INT\t\\\n-\t && GET_MODE_SIZE (M) < 8)\t\t\\\n-\tM = DImode;\t\t\t\t\\\n+\t && GET_MODE_SIZE (M) < 4)\t\t\\\n+\tM = SImode;\t\t\t\t\\\n } while (0)\n \n /* Align argument parameters on the stack to 64-bit, at a minimum. */\ndiff --git a/gcc/testsuite/gcc.target/bpf/btfext-lineinfo.c b/gcc/testsuite/gcc.target/bpf/btfext-lineinfo.c\nindex dc1c297d663e..9d3a68e2ddef 100644\n--- a/gcc/testsuite/gcc.target/bpf/btfext-lineinfo.c\n+++ b/gcc/testsuite/gcc.target/bpf/btfext-lineinfo.c\n@@ -38,12 +38,12 @@ int bar_func (struct T *t)\n \n /* { dg-final { scan-assembler-times \"btfext-lineinfo\\.c.0\\\"\\[\\t \\]+\\[^\\n\\]*btf_aux_string\" 1 } } */\n /* { dg-final { scan-assembler-times \"4byte\\[\\t \\]+\\.LFB.\\[\\t \\]+# insn_label\" 2 } } */\n-/* { dg-final { scan-assembler-times \"4byte\\[\\t \\]+LI.\\[\\t \\]+# insn_label\" 6 } } */\n+/* { dg-final { scan-assembler-times \"4byte\\[\\t \\]+LI.\\[\\t \\]+# insn_label\" 8 } } */\n \n-/* { dg-final { scan-assembler-times \"# \\\\(line, col\\\\)\" 8 } } */\n+/* { dg-final { scan-assembler-times \"# \\\\(line, col\\\\)\" 10 } } */\n /* { dg-final { scan-assembler-times \"# \\\\(line, col\\\\) \\\\(18, 5\\\\)\" 1 } } */\n-/* { dg-final { scan-assembler-times \"# \\\\(line, col\\\\) \\\\(20, 10\\\\)\" 1 } } */\n-/* { dg-final { scan-assembler-times \"# \\\\(line, col\\\\) \\\\(21, 18\\\\)\" 1 } } */\n+/* { dg-final { scan-assembler-times \"# \\\\(line, col\\\\) \\\\(20, 10\\\\)\" 2 } } */\n+/* { dg-final { scan-assembler-times \"# \\\\(line, col\\\\) \\\\(21, 18\\\\)\" 2 } } */\n /* { dg-final { scan-assembler-times \"# \\\\(line, col\\\\) \\\\(22, 1\\\\)\" 1 } } */\n /* { dg-final { scan-assembler-times \"# \\\\(line, col\\\\) \\\\(25, 5\\\\)\" 1 } } */\n /* { dg-final { scan-assembler-times \"# \\\\(line, col\\\\) \\\\(28, 7\\\\)\" 1 } } */\n", "prefixes": [ "3/3" ] }