get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2229255/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2229255,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229255/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/35dbaaa2-ec30-4aee-954a-e667dc4f2947@oss.qualcomm.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/1.1/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": "<35dbaaa2-ec30-4aee-954a-e667dc4f2947@oss.qualcomm.com>",
    "date": "2026-04-27T22:25:02",
    "name": "[to-be-committed,RISC-V,PR,tree-optimization/94892] Improve equality test of sign bit splat against zero",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "5b57c379702bd150dfa1bbca2f8f9df92873e64e",
    "submitter": {
        "id": 92310,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/92310/?format=api",
        "name": "Jeffrey Law",
        "email": "jeffrey.law@oss.qualcomm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/35dbaaa2-ec30-4aee-954a-e667dc4f2947@oss.qualcomm.com/mbox/",
    "series": [
        {
            "id": 501736,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501736/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501736",
            "date": "2026-04-27T22:25:02",
            "name": "[to-be-committed,RISC-V,PR,tree-optimization/94892] Improve equality test of sign bit splat against zero",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501736/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2229255/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2229255/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\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=jki4xLmC;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=JmBkkIQS;\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=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=jki4xLmC;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=JmBkkIQS",
            "sourceware.org; dmarc=none (p=none dis=none)\n header.from=oss.qualcomm.com",
            "sourceware.org;\n spf=pass smtp.mailfrom=oss.qualcomm.com",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=205.220.168.131"
        ],
        "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 4g4J6q4kcyz1xrS\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 08:25:38 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 852964B9DB6A\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 22:25:36 +0000 (GMT)",
            "from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com\n [205.220.168.131])\n by sourceware.org (Postfix) with ESMTPS id 6D75E4BA902C\n for <gcc-patches@gcc.gnu.org>; Mon, 27 Apr 2026 22:25:07 +0000 (GMT)",
            "from pps.filterd (m0279865.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63RKrETK3962098\n for <gcc-patches@gcc.gnu.org>; Mon, 27 Apr 2026 22:25:06 GMT",
            "from mail-dy1-f198.google.com (mail-dy1-f198.google.com\n [74.125.82.198])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dt4k335u9-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <gcc-patches@gcc.gnu.org>; Mon, 27 Apr 2026 22:25:05 +0000 (GMT)",
            "by mail-dy1-f198.google.com with SMTP id\n 5a478bee46e88-2ddd8ef5343so10651521eec.1\n for <gcc-patches@gcc.gnu.org>; Mon, 27 Apr 2026 15:25:05 -0700 (PDT)",
            "from [172.31.0.17] ([136.38.201.137])\n by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2ed0a10678csm745979eec.24.2026.04.27.15.25.02\n for <gcc-patches@gcc.gnu.org>\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Mon, 27 Apr 2026 15:25:03 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 852964B9DB6A",
            "OpenDKIM Filter v2.11.0 sourceware.org 6D75E4BA902C"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 6D75E4BA902C",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 6D75E4BA902C",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777328707; cv=none;\n b=loYAREIqPvdVb6+Vq93VW2c2vMLwoQMTd+hazF/ZSavXiN9+pXiJxfviFGZYWVhTJLUVdez4Abaz92rkNFw397+hGE8bf9krrXByhvFEPj811khrHrIrw2UT3BDuqtJ1ZkOwQH0pY8eeYkS+nel5QO1B/OmTygh39BHx82wG1nI=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777328707; c=relaxed/simple;\n bh=NUEd+YNgz7T8DiSOimIkSai0lNnLJflalCH4uTFSg/c=;\n h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version:From:\n To:Subject;\n b=eI0s2HI5b0vP5f9S1AxURKS6Qj+BPVrDZtBQgkY6t1toiQoYmemOGoEdMJOnLCZBavnrSwyD7jEsph5UHsEg1hIQ+ujPyWjcAtPBde7BPUr4aFmTBjfg3Z9X4l1HzxO8BwXW2XU62PM9X6/uqPAqEBBWqIZRRQXx9M3lE3NLO9E=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n content-type:date:from:message-id:mime-version:subject:to; s=\n qcppdkim1; bh=n8Yw0dCNklI+VjiH9nCUJ5CP77jM/PxRztM14cSA8c4=; b=jk\n i4xLmCtCtBgnMMXdyxdEfQ+EVVBLzzqIjmPmhzcTzDY+2/JSxnyomUlwJqNY9H3G\n 87jFsGKbJIeTF8pksADPgdxym48RJ0HMFkj5icLEZMyVu5Tv4+Df9mEzz0m6sjr8\n ZzHv1zkjH2DxSUrwh9txBILsKRUT70lrDYYLb86uNVMbelJSC1iJZbZ+SCoW7vKT\n Rp1JS1bEP3/Wb25BXIXF95CyJAof4+qoYlsW6YAViriiarGUjKb7IKX52u0pS/DE\n 21U8X23hXnPyIU/2TZLICQrJBXUUqbAAm2Sug6xbDv/q8ZbZnSmV0/YOV8ggJb3p\n t+InvNeb5Y0OxOW08Kow==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1777328705; x=1777933505; darn=gcc.gnu.org;\n h=subject:to:from:content-language:user-agent:mime-version:date\n :message-id:from:to:cc:subject:date:message-id:reply-to;\n bh=n8Yw0dCNklI+VjiH9nCUJ5CP77jM/PxRztM14cSA8c4=;\n b=JmBkkIQSDigKnZ50V1y8nxY4XEMI9HyyDlk+jJLG3icXmJT/yBI1FWFRz6kNu0JFMa\n fLeleno1lk7Pe79GFZlxNO+1ObuRHay691bqgwlUOpiDVBFCoVwp0PYgv48mLyKWm0Yc\n XuGnHjd1EOJIIwV3TxZ7XmYJg+C9AT0a9ip6evpY1a0+H7ufHqR+1QDNO97xrl1r+cBk\n sxv8GexPVpY57qQSyE8TNnBjcd0X3SnpUDNEk6mfRp2K8y3PYXADPyhmXdjji2hEdqep\n 386CMJjqIyTcHWvoKXHY7zoyedYM5OXnEhQBkihtmHKz3mFuD/vmyKNaKIg1T6tijzru\n s8vw=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777328705; x=1777933505;\n h=subject:to:from:content-language:user-agent:mime-version:date\n :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=n8Yw0dCNklI+VjiH9nCUJ5CP77jM/PxRztM14cSA8c4=;\n b=b6ZrwCevlezfSj7slyNICyy5/ZcctXa3l/laQ8wFVVeVEOKKE9RUgk3bzo2UTo3Ktq\n MwdA11CBoQ7CWR8ipm/pwLT+yGj6SNVarbckY0dAVJjCCgTLOMCVfhp1TCANUNL93i5m\n H+zALPH5RRUg1T6iWYjOHMuRtVheqRxHrxStXzGBPGGRZNPtC1hTzbm1D34tv9chR3vQ\n EY6sYs6bGqjqwIi3tBPJs04NtMZGVF5xKmMvz5S6Ds13dpe+pcZWq5vznjb0VSGKkbZ5\n rbeNzElXttTm5vIBvyUTk3ZdwiFnwK04TxOv3egrxX9L8MR37dUSJm9B/SZwmDZNSqun\n iIow==",
        "X-Gm-Message-State": "AOJu0YzmFwOoeP57p2KPEIVXmQDVizJnmvpZHao7M6nqVgxVQi5OFpc0\n kfHMQGo/xsJR3iViLbi0FF9pOalMe4av0xjmdQBC6FEVKEu5KPr0GhtPkyo3oFV4k81E/LROOWd\n r2BISde9nugMhYY6AzMDn7aMCommMO43KehEhUf8gJzN1D25ZkF6ZpyLH+ldoWyq4uRUU",
        "X-Gm-Gg": "AeBDiet+qkv2vpuuwSTIQIwsJ+y7bFhnT9CB5K1+8cH9pjUQ687Nmh5CGi9rhSdZHap\n mVqSl1tqEPLk0JL8cNqyENm0zspR8omG6rnXcv6iFdY3cd2ShX8gU1gAIhuYDEceNy6llxJK9bP\n u3kS7JoGgW5DX9RoymRhkejYIBN1pzOOINeYKMSwYY/6QZs6ITXvyoB6YYvq8iDJ6x6Up3luDry\n PksedsYUlOCmk/bmkW2mrxmRhEVN3re5DMFY8e/JDg87t2Vzqbpzs9tFJNSw/afmegVJcLYX3n4\n TUYCukRu1xs8g0mjQLwKYa7CDhl5RCdixG9DOotrSNdK6c0IJ9Cxy1DpwYj3E1qAykA9coRVTBl\n lPAnrrRsv43SwikVRPrwqXma1oo7aYgjVfcGnCfou9YKWRud7Wtww9q4deEvw",
        "X-Received": [
            "by 2002:a05:7301:578e:b0:2ce:25be:c8e8 with SMTP id\n 5a478bee46e88-2ed0a0d954dmr375410eec.17.1777328704754;\n Mon, 27 Apr 2026 15:25:04 -0700 (PDT)",
            "by 2002:a05:7301:578e:b0:2ce:25be:c8e8 with SMTP id\n 5a478bee46e88-2ed0a0d954dmr375400eec.17.1777328704101;\n Mon, 27 Apr 2026 15:25:04 -0700 (PDT)"
        ],
        "Content-Type": "multipart/mixed; boundary=\"------------4uxSuGcqUIUgGYDL5seDoYjA\"",
        "Message-ID": "<35dbaaa2-ec30-4aee-954a-e667dc4f2947@oss.qualcomm.com>",
        "Date": "Mon, 27 Apr 2026 16:25:02 -0600",
        "MIME-Version": "1.0",
        "User-Agent": "Mozilla Thunderbird",
        "Content-Language": "en-US",
        "From": "Jeffrey Law <jeffrey.law@oss.qualcomm.com>",
        "To": "'GCC Patches' <gcc-patches@gcc.gnu.org>",
        "Subject": "[to-be-committed][RISC-V][PR tree-optimization/94892] Improve\n equality test of sign bit splat against zero",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDI3MDIzNyBTYWx0ZWRfX62Dg/q4YfOwz\n va+TTsRxwMH9Ezyklm/rkx9tzPP80pcdtfQoZQGTVNnX49y6ooHaePoXbhHgzCW1deRRsd9G5Bs\n w1nFwyX1eN0VI+mcsEFJflp2np6yPZmAcawwer+N1Ev2aG2axGJmdimZ0fYJWN16MNuwIyGMI7d\n 3GJ/FC4OVCS5TXj2l1hpQIj3hpYTw6N9bVdqWa/4qGqwmndMEHUD2Tb2GORd8ugtDHXtpt28H3b\n rgglA5ng1oV10N/hdjvFXnIn3rYVEVCusantVoKV2xPLpLdinP76MJM1odyd9bUjrgOFbBlZBZ7\n Gr0OUL2BjBptr7Zd54hvxA2EyALGgRyxhRnHnXvgAmByNIIFempJuwuw+76RQnmHFULSw61wFvC\n 3GeiyEzROKqLzieUpG8SGY76Fq+tzKsWWkSRjgv5JSGlbGmeXKUPA9g4WQ/3Uydi8hZCBe18gN0\n q+p7FBbqyBBGbKguUTQ==",
        "X-Authority-Analysis": "v=2.4 cv=a7QAM0SF c=1 sm=1 tr=0 ts=69efe241 cx=c_pps\n a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=asGLMfRmzhnGNxaIYohjRg==:17\n a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=r77TgQKjGQsHNAKrUKIA:9\n a=s04xLfcmEwkVawN4_ygA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10\n a=zZCYzV9kfG8A:10 a=N_4x_5H8HbEHI2L3iQ0A:9 a=B2y7HmGcmWMA:10\n a=bBxd6f-gb0O0v-kibOvt:22",
        "X-Proofpoint-GUID": "N9MQ0dnUQo1j_yLcsrNDLsQ3UEzc4Wpo",
        "X-Proofpoint-ORIG-GUID": "N9MQ0dnUQo1j_yLcsrNDLsQ3UEzc4Wpo",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n clxscore=1015 malwarescore=0 spamscore=0 phishscore=0 impostorscore=0\n lowpriorityscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 adultscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604270237",
        "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": "One of the tests in pr94892 showed a case where we failed to convert a \nsign bit splat + equality test against into a simple lt/ge test which \ndoesn't require the sign bit splat.\n\nThis is only failing on rv64, probably because the case in question has \na DI sign bit splat, then we take a lowpart SI subreg.  The lowpart \ndance isn't needed for rv32, though I've structured the test to verify \nthat we get sensible code on rv32 as well as rv64.\n\nLike many other patches I'm submitting now, this has been in my tester \nfor a while, but the test has not.  I'll be waiting on the pre-commit \ntester to verify sanity before moving forward.  I'm particularly \ninterested to see how it behaves with no -march flags.  It should be \ntaking the defaults from when the toolchain was built, which should do \nwhat we want.\n\nJeff\n\nps.  Interestingly enough the last two patches I've submitted haven't \nbeen picked up by the CI system yet.  Slow job starting seems to be the \nnorm right now.\nPR tree-optimization/94892\ngcc/\n\t* config/riscv/riscv.md (sign_bit_splat_equality_test): New pattern.\n\ngcc/testsuite/\n\n\t* gcc.target/riscv/pr94892.c: New test.",
    "diff": "diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md\nindex c350283fa344..716357e6221d 100644\n--- a/gcc/config/riscv/riscv.md\n+++ b/gcc/config/riscv/riscv.md\n@@ -5123,6 +5123,48 @@ (define_split\n   operands[6] = gen_int_mode (rshift, QImode);\n }\")\n \n+;; EQ/NE of a sign bit splat against zero is just GE/LT 0, so we can\n+;; recognize it directly.  Note there may be a subreg expression buried\n+;; in there\n+(define_insn \"*sign_bit_splat_equality_test\"\n+  [(set (pc)\n+\t(if_then_else\n+\t (any_eq\n+\t  (subreg:SI (ashiftrt:DI (match_operand:DI 1 \"register_operand\" \"r\")\n+\t\t\t\t  (const_int 63)) 0)\n+\t  (const_int 0))\n+\t (label_ref (match_operand 0 \"\" \"\"))\n+\t (pc)))]\n+  \"TARGET_64BIT\"\n+{\n+  rtx x = PATTERN (insn);\n+\n+  /* We'll always have a SET, so it's safe to extract the source.  */\n+  x = SET_SRC (x);\n+\n+  /* Get the condition of the IF_THEN_ELSE.  */\n+  x = XEXP (x, 0);\n+\n+  if (GET_CODE (x) == EQ)\n+    {\n+      if (get_attr_length (insn) == 12)\n+\treturn \"blt\\t%1,zero,1f; jump\\t%l0,ra; 1:\";\n+      return \"bge\\t%1,zero,%l0\";\n+    }\n+  else if (GET_CODE (x) == NE)\n+    {\n+      if (get_attr_length (insn) == 12)\n+\treturn \"bge\\t%1,zero,1f; jump\\t%l0,ra; 1:\";\n+      return \"blt\\t%1,zero,%l0\";\n+    }\n+  else\n+    gcc_unreachable ();\n+}\n+  [(set_attr \"type\" \"branch\")\n+   (set_attr \"mode\" \"none\")])\n+\t\t\t\t\t\n+\t\n+\n ;; Standard extensions and pattern for optimization\n (include \"bitmanip.md\")\n (include \"crypto.md\")\ndiff --git a/gcc/testsuite/gcc.target/riscv/pr94892.c b/gcc/testsuite/gcc.target/riscv/pr94892.c\nnew file mode 100644\nindex 000000000000..2d9968e0fa09\n--- /dev/null\n+++ b/gcc/testsuite/gcc.target/riscv/pr94892.c\n@@ -0,0 +1,10 @@\n+static inline int sign(int x)\n+{\n+    return (x >> 31) | ((unsigned)-x >> 31);\n+}\n+\n+bool f(int x)\n+{\n+    return sign(x) > -1;\n+}\n+\n",
    "prefixes": [
        "to-be-committed",
        "RISC-V",
        "PR",
        "tree-optimization/94892"
    ]
}