Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2232117/?format=api
{ "id": 2232117, "url": "http://patchwork.ozlabs.org/api/patches/2232117/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/63a2d5f9-5dd1-49d3-8984-5db4a9a7a81a@yahoo.co.jp/", "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": "<63a2d5f9-5dd1-49d3-8984-5db4a9a7a81a@yahoo.co.jp>", "list_archive_url": null, "date": "2026-05-02T18:14:43", "name": "[v2,3/4] xtensa: Implement \"-mforce-l32\" target-specific option", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "91789bd7903fc061fbc385911a5ae182345423d7", "submitter": { "id": 83997, "url": "http://patchwork.ozlabs.org/api/people/83997/?format=api", "name": "Takayuki 'January June' Suwa", "email": "jjsuwa_sys3175@yahoo.co.jp" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/63a2d5f9-5dd1-49d3-8984-5db4a9a7a81a@yahoo.co.jp/mbox/", "series": [ { "id": 502546, "url": "http://patchwork.ozlabs.org/api/series/502546/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=502546", "date": "2026-05-02T18:14:43", "name": "[v2,1/4] xtensa: Implement \"__force_l32\" named address space", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/502546/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2232117/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2232117/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 (2048-bit key;\n unprotected) header.d=yahoo.co.jp header.i=@yahoo.co.jp header.a=rsa-sha256\n header.s=yahoocojp-202506 header.b=jsV7bM/3;\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 (2048-bit key,\n unprotected) header.d=yahoo.co.jp header.i=@yahoo.co.jp header.a=rsa-sha256\n header.s=yahoocojp-202506 header.b=jsV7bM/3", "sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=yahoo.co.jp", "sourceware.org; spf=pass smtp.mailfrom=yahoo.co.jp", "server2.sourceware.org;\n arc=none smtp.remote-ip=124.83.189.84" ], "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 4g7GP20mG4z1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 03 May 2026 04:18:12 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 7FDCE4AA0964\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 2 May 2026 18:18:10 +0000 (GMT)", "from omggw2011-vm0.mail.snz.yahoo.co.jp\n (omggw2011-vm0.mail.snz.yahoo.co.jp [124.83.189.84])\n by sourceware.org (Postfix) with ESMTPS id A07E04BB58DB\n for <gcc-patches@gcc.gnu.org>; Sat, 2 May 2026 18:17:35 +0000 (GMT)", "from sonicgw.mail.gze.yahoo.co.jp by\n sonicconh5101.mail.kks.ynwp.yahoo.co.jp with HTTP;\n Sat, 2 May 2026 18:17:32 +0000", "by smtphe5111.mail.kks.ynwp.yahoo.co.jp (YJ Hermes SMTP Server) with\n ESMTPA ID ce25e26f3effdff83f174126671b1bdb;\n Sun, 03 May 2026 03:17:31 +0900 (JST)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 7FDCE4AA0964", "OpenDKIM Filter v2.11.0 sourceware.org A07E04BB58DB" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org A07E04BB58DB", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org A07E04BB58DB", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777745856; cv=none;\n b=KpaXtEvm/WhWgZmVbDCz29+URkmJ9h6NAs+JBCRMVoZ0oEZuOTICIF5hbudzwZlyDzkkkD9tijx392zggUaupU0PQcUsZbPGJi0gpej73X/EkTN7iXmLoy1GYyw5MSdmFTsrqXAY/i0mq6L43koyMr9nGf5JC8BmCNLb66V56+M=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777745856; c=relaxed/simple;\n bh=6r0kWYyPWZ/dAAhgwl6wYu4Hrcv72lBRPxSe9kKoM14=;\n h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject;\n b=fvXvvTuezypfB6k65Lr46KJoa6zplq+pByYVsWU3qRFBp3cZxJqvoIQsPzkqN2zmwRk+b7aP4Lw7AKzJ9Y2aHTITde9j3Q6V1d6fQ6TNURPZH0UCURfGzVnlO5aLgTGJnn8ebTUMhVHjzKmGkJrHwj3PDwF8iIV9rhGGM1Ot2XQ=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "X-YMail-OSG": "A7w/9mkCANOkbDgMhZVXS048/LqCZ2X0rOZbLrtXDGuudzspodok6RO8Bq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S8EQCHfML8MWYBpdoVm6Vpbz6jUuj1ZvmUCEoq\n 1j8kfcoxK3wU6H9cTtj2tntWugcZm06iBlsVfcIi9VGC6zrupRNxDiTrTo7nIbpCSv9hMxP0NXcK\n iW7u7deSvXKXdZ/r+JRJ8l5whGtdK5x0khzAiX7+gnRhe5OLsOYVw9NTA0VPa2KZUpK2qEcQq+C5\n LGwMqc7VxeaDIGNrWxY0aW4fFxHDYe9Wrmz2397NuAay6x8j+pnW7tK+bEn7mr2wq6Qc2gfV2fLY\n DDOA92zdDmhr5n+WfFAPulvOj0rvc88PcdME2P/bV7Nz772EU3FDYTHpFgmXPDzu1kI8SjAcpPPh\n ICf+hYtMJuwNjvd4iUBFWhqITu6w9a/OJUaqMEKIpxzpV0NiwD/PLwwBkCVu4gPxWti3AbmwOfYn\n UTVXGqKPUxDr1Fbxlo+bmlRZIBckGgESBpEkLB1SQuvxKTTykWFzMHegfx0Nj92yY9OUOR0CA7IS\n fVrGDIPRlTh2f0WYZ3Hhn8KTRLTaneplBIuRgmjdyBxFwIayWARsXL42FvuYDIcI7osf9R2YhU2H\n QCugaYRPU2vg9ek/3YffyKpamZhHKW6Z7idhAKcoGkvuzKCCMb3G2yTrEsuAX4Vp9G2MH6cyae8O\n bSZ77Akm3J+Liw3FZq9ZWRdVd84q3kytZ7cODwogec4HBgcZu9MIaEmPJ", "X-Sonic-MF": "jjsuwa_sys3175@yahoo.co.jp", "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1777745683;\n s=yahoocojp-202506; d=yahoo.co.jp;\n h=References:Content-Transfer-Encoding:Content-Type:Subject:From:Cc:To:MIME-Version:Date:Message-ID;\n bh=s7VGvRMgjnE9Tb7vI84T1uVtlj46o1HdsIJ1TQFjGes=;\n b=jsV7bM/3ijPr0KpbLSwCB03IF4378WWJhOe7t5wcXuYrhosCu1l1hIAdjtx9060k\n 2CBdcOud8vZi6RZuuKrOmTIPscA0DAnsX1lIfYTG+mVJNlspH66kMigtHbBYf+Izgyo\n jTpI/5/VH4MLDIimF38fgoKHsnn4DfgKsLxDsRMeE+EoyoyI9+pD9MHkDX/6f6OxejI\n RPRhNyKJ7ucGHLmjki19TaFM5jaddkG6eYjc5/GMJdsWUG/rPCnKFjSdK1JqyDJsk4Q\n WYqwrBDPttqjIcVJOrT3WZEFRW36Ztyu8vJhCYp1aMBo4p1LiM2qjA8sHrj2G4Wxw99\n YF9Bc6LXBw==", "Message-ID": "<63a2d5f9-5dd1-49d3-8984-5db4a9a7a81a@yahoo.co.jp>", "Date": "Sun, 3 May 2026 03:14:43 +0900", "MIME-Version": "1.0", "User-Agent": "Mozilla Thunderbird", "Content-Language": "en-US", "To": "gcc-patches@gcc.gnu.org", "Cc": "Max Filippov <jcmvbkbc@gmail.com>", "From": "Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>", "Subject": "[PATCH v2 3/4] xtensa: Implement \"-mforce-l32\" target-specific option", "Content-Type": "text/plain; charset=UTF-8; format=flowed", "Content-Transfer-Encoding": "7bit", "References": "<63a2d5f9-5dd1-49d3-8984-5db4a9a7a81a.ref@yahoo.co.jp>", "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": "In the previous patches, both the named address space \"__force_l32\" and\nthe target-specific attribute \"force_l32\" were introduced for reading\nsub-words from the instruction memory area.\n\nThis patch introduces a new target-specific option \"-mforce-l32\", which\nallows sub-word reading from the instruction memory area even in the\ngeneric address spaces (ie., the default memory references) or without\nthe \"force_l32\" attribute.\n\n /* example */\n int test(unsigned int i) {\n static const char string[] __attribute__((section(\".irom.text\")))\n = \"The quick brown fox jumps over the lazy dog.\";\n return i < __builtin_strlen(string) ? string[i] : -1;\n }\n\n ;; result (-O2 -mforce-l32)\n \t.literal_position\n \t.literal .LC0, string$0\n test:\n \tentry\tsp, 32\n \tmovi.n\ta8, 0x2b\n \tbltu\ta8, a2, .L3\n \tl32r\ta9, .LC0\t;; If -mno-force-l32,\n \tmovi.n\ta8, -4\t\t;;\n \tadd.n\ta9, a9, a2\t;;\tl32r\ta8, .LC0\n \tand\ta8, a9, a8\t;;\tadd.n\ta8, a8, a2\n \tl32i.n\ta8, a8, 0\t;;\tl8ui\ta2, a8, 0\n \tssa8l\ta9\t\t;;\n \tsrl\ta8, a8\t\t;;\n \textui\ta2, a8, 0, 8\t;;\n \tretw.n\n .L3:\n \tmovi.n\ta2, -1\n \tretw.n\n \t.section .irom.text,\"a\"\n string$0:\n \t.string\t\"The quick brown fox jumps over the lazy dog.\"\n\ngcc/ChangeLog:\n\n\t* config/xtensa/xtensa.cc (xtensa_expand_load_force_l32_2):\n\tNew sub-function for inspecting pseudos that clearly point to the\n\tfunction's stack frame.\n\t(xtensa_expand_load_force_l32):\n\tAdd handling for loading from the generic address space when the\n\t\"-mforce-l32\" option is enabled, however, obvious references to\n\tfunction stack frames are excluded.\n\t* config/xtensa/xtensa.opt (mforce-l32):\n\tNew target-specific option definition.\n---\n gcc/config/xtensa/xtensa.cc | 36 ++++++++++++++++++++++++++++++++----\n gcc/config/xtensa/xtensa.opt | 4 ++++\n 2 files changed, 36 insertions(+), 4 deletions(-)", "diff": "diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc\nindex 1b4aa8934ff..5a9b18de1ce 100644\n--- a/gcc/config/xtensa/xtensa.cc\n+++ b/gcc/config/xtensa/xtensa.cc\n@@ -2628,7 +2628,7 @@ xtensa_emit_add_imm (rtx dst, rtx src, HOST_WIDE_INT imm, rtx scratch,\n load with bit-extraction of the required bytes. */\n \n static bool\n-xtensa_expand_load_force_l32_1 (rtx mem)\n+xtensa_expand_load_force_l32_1 (const_rtx mem)\n {\n tree expr = MEM_EXPR (mem), type;\n \n@@ -2639,6 +2639,29 @@ xtensa_expand_load_force_l32_1 (rtx mem)\n \t && lookup_attribute (\"force_l32\", TYPE_ATTRIBUTES (type));\n }\n \n+static bool\n+xtensa_expand_load_force_l32_2 (const_rtx reg)\n+{\n+ unsigned int regno;\n+\n+ /* These pseudos are unlikely to be passed during the RTL generation,\n+ but just in case. */\n+ switch (regno = REGNO (reg))\n+ {\n+ case STACK_POINTER_REGNUM:\n+ case FRAME_POINTER_REGNUM:\n+ case ARG_POINTER_REGNUM:\n+ return true;\n+ }\n+\n+ /* gccint explicitly states that these pseudos indicate the location of\n+ the stack frame. In addition, the static chain pointers also clearly\n+ refer to the stack frame. */\n+ return IN_RANGE (regno, FIRST_VIRTUAL_REGISTER, LAST_VIRTUAL_REGISTER)\n+\t || (cfun && cfun->static_chain_decl\n+\t && cfun->static_chain_decl == REG_EXPR (regno_reg_rtx[regno]));\n+}\n+\n bool\n xtensa_expand_load_force_l32 (rtx *operands, machine_mode dest_mode,\n \t\t\t machine_mode src_mode, int unsignedp)\n@@ -2670,13 +2693,17 @@ xtensa_expand_load_force_l32 (rtx *operands, machine_mode dest_mode,\n \n /* Exclude insns that do not perform memory loading with \"force_l32\". */\n if (MEM_ADDR_SPACE (src) != ADDR_SPACE_FORCE_L32\n- && ! xtensa_expand_load_force_l32_1 (src))\n+ && ! xtensa_expand_load_force_l32_1 (src)\n+ && (!TARGET_FORCE_L32 || MEM_ADDR_SPACE (src) != ADDR_SPACE_GENERIC))\n return false;\n \n /* As a preprocessing, handle cases where addr is (PLUS (REG, OFFSET))\n form. */\n if (REG_P (addr = XEXP (src, 0)))\n- ;\n+ {\n+ if (xtensa_expand_load_force_l32_2 (addr))\n+\treturn false;\n+ }\n else if (GET_CODE (addr) == PLUS)\n {\n rtx op0 = XEXP (addr, 0), op1 = XEXP (addr, 1);\n@@ -2684,7 +2711,8 @@ xtensa_expand_load_force_l32 (rtx *operands, machine_mode dest_mode,\n \n if (! CONST_INT_P (op1))\n \tstd::swap (op0, op1);\n- if (! REG_P (op0) || ! CONST_INT_P (op1))\n+ if (! REG_P (op0) || ! CONST_INT_P (op1)\n+\t || xtensa_expand_load_force_l32_2 (op0))\n \treturn false;\n if ((v = INTVAL (op1)) == 0)\n \taddr = op0;\ndiff --git a/gcc/config/xtensa/xtensa.opt b/gcc/config/xtensa/xtensa.opt\nindex aee776f124e..90665ba180c 100644\n--- a/gcc/config/xtensa/xtensa.opt\n+++ b/gcc/config/xtensa/xtensa.opt\n@@ -71,3 +71,7 @@ Use windowed registers ABI.\n mstrict-align\n Target Var(xtensa_strict_alignment) Init(XTENSA_STRICT_ALIGNMENT_UNDEFINED)\n Do not use unaligned memory references.\n+\n+mforce-l32\n+Target Mask(FORCE_L32)\n+Use L32I instruction to access 1- and 2-byte quantities in memory instead of L8UI/L16UI/L16SI.\n", "prefixes": [ "v2", "3/4" ] }