{"id":2215734,"url":"http://patchwork.ozlabs.org/api/patches/2215734/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/cc3b3b97-90c7-4a1e-9a9d-60364657f932@linux.ibm.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/projects/17/?format=json","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":"<cc3b3b97-90c7-4a1e-9a9d-60364657f932@linux.ibm.com>","list_archive_url":null,"date":"2026-03-25T08:53:21","name":"[V2] rs6000: Fix [su]mul_highpart patterns to use unspec [PR122665]","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"e9f1b210d07163e59a5e753479abb17841254541","submitter":{"id":88218,"url":"http://patchwork.ozlabs.org/api/people/88218/?format=json","name":"jeevitha","email":"jeevitha@linux.ibm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/cc3b3b97-90c7-4a1e-9a9d-60364657f932@linux.ibm.com/mbox/","series":[{"id":497396,"url":"http://patchwork.ozlabs.org/api/series/497396/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=497396","date":"2026-03-25T08:53:21","name":"[V2] rs6000: Fix [su]mul_highpart patterns to use unspec [PR122665]","version":2,"mbox":"http://patchwork.ozlabs.org/series/497396/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2215734/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2215734/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=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=IkcLk1nG;\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=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=IkcLk1nG","sourceware.org;\n dmarc=none (p=none dis=none) header.from=linux.ibm.com","sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com","server2.sourceware.org;\n arc=none smtp.remote-ip=148.163.158.5"],"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 4fgggd6BJxz1y1K\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 19:54:04 +1100 (AEDT)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 5ED9E4BB58C6\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 08:53:57 +0000 (GMT)","from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n [148.163.158.5])\n by sourceware.org (Postfix) with ESMTPS id 8E5F04BB589B\n for <gcc-patches@gcc.gnu.org>; Wed, 25 Mar 2026 08:53:28 +0000 (GMT)","from pps.filterd (m0360072.ppops.net [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 62P4p94M3303794; Wed, 25 Mar 2026 08:53:27 GMT","from ppma12.dal12v.mail.ibm.com\n (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4d1kumptm2-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Wed, 25 Mar 2026 08:53:27 +0000 (GMT)","from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1])\n by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id\n 62P5nQOW031631;\n Wed, 25 Mar 2026 08:53:26 GMT","from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8])\n by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4d25nswvr5-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Wed, 25 Mar 2026 08:53:26 +0000","from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com\n [10.39.53.230])\n by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 62P8rP5830605836\n (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Wed, 25 Mar 2026 08:53:25 GMT","from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 367ED58054;\n Wed, 25 Mar 2026 08:53:25 +0000 (GMT)","from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 1E1A35805A;\n Wed, 25 Mar 2026 08:53:23 +0000 (GMT)","from [9.98.105.13] (unknown [9.98.105.13])\n by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP;\n Wed, 25 Mar 2026 08:53:22 +0000 (GMT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 5ED9E4BB58C6","OpenDKIM Filter v2.11.0 sourceware.org 8E5F04BB589B"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 8E5F04BB589B","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 8E5F04BB589B","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774428808; cv=none;\n b=U5vQYjhzW0INTJQ1qkHnMAr2ngrTlbb9L4AVeTd4qIGopoBJ4X45rZ9G4bGSvMgj16H8LgZrw6Uu7bZjGcY9x1Ln8/VEzxjUC9h0j+r7ZprF0n0pUakZNs5Ovp5PvNfOjMabXBtcxkKnbwOP4cRca5sfk5GXfsTGox46UAUOi3Y=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774428808; c=relaxed/simple;\n bh=qSKoXMeT2Nj/Sm8Bfc0o0Fid3kx3PQ6amlhmKqkQO/s=;\n h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To;\n b=xnsbiNT69LCuXEtdN0neCkq+5+ug9C9jM1alS3MpDlzUP3jnI4h0894wGLMy1O/BIdVTWs4Us3IT3Bqj5q8EZGdcXeF+5YjKE8ijD8D5JQUeTw8rKXA812ei/vwOH+coPpkEbQrFC1kJ+rM6XVh3+falY9LUAt4cVFMjcNDNkws=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=\n content-transfer-encoding:content-type:date:from:message-id\n :mime-version:subject:to; s=pp1; bh=+al4FWcQcYQN5jU+036u0H7388gS\n OoMNMALpjqOV1lU=; b=IkcLk1nGj4tan97hUCIOO6o0gVhyvJi3sgaJ6lOzn+HQ\n Tv88W3bF6ILJjtcGCANtegxtx7ufuHZy6af9RHWr6v7q1gBAfgJNDj+5ouEl9f/u\n ZQJNJUgE3lcNeQkaJeX8VsXrhTe3CITpqdJRN0TrXWik1nl7iuqyvg9fzOeFoOdp\n p+XO6DZtl33csCLFPqnqByF3ke+B0qNr6RqHlDiL9iMlby6kMyjUha9ICZIojAsa\n JxPUXl28ZW69obwMjVqc4gIC/EjHTthjwvpdYAAAPtoXjAVJZvwtHNH01LuSNE7n\n UBZlMX8476GZXCscsrbzJAShYf5WUDY2d4OP7Bur1A==","Message-ID":"<cc3b3b97-90c7-4a1e-9a9d-60364657f932@linux.ibm.com>","Date":"Wed, 25 Mar 2026 14:23:21 +0530","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","From":"jeevitha <jeevitha@linux.ibm.com>","Content-Language":"en-US","Subject":"[PATCH V2] rs6000: Fix [su]mul_highpart patterns to use unspec\n [PR122665]","To":"mmatti@linux.ibm.com, Michael Meissner <meissner@linux.ibm.com>,\n Surya Kumari Jangala <jskumari@linux.ibm.com>,\n Segher Boessenkool <segher@kernel.crashing.org>,\n GCC Patches <gcc-patches@gcc.gnu.org>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","X-TM-AS-GCONF":"00","X-Proofpoint-GUID":"Bwwv825AvPra05OpgozC-z5lQ3MBk2It","X-Proofpoint-ORIG-GUID":"Bwwv825AvPra05OpgozC-z5lQ3MBk2It","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwMzI1MDA2MiBTYWx0ZWRfX5qGy5zcbNdEX\n 256xqtttNGCIVjZjeoa4HejGyy1aOGrIQnfGnLD10LH64aUsIYek/RBrHONDBbiwh1RynMAA35L\n 22PNmqv8b2euA1wQVkvKCzm9Om0KnCiP+6FPne/qr17xGPds1hGn8PlCuaZfz/DyJJAXbwkF8sC\n rKLJ31K+0ey3tvumB1QsyBsI6pbOSFyZ+Q2151Et3qsnDwKoWhGUtGI2gbVMxNhVdQllIF6ZCPM\n nvI7gvzegqJJKrQpK77+I2UB+7SFt5k4F9e8QVCHYMFPmRuwDlY0qDgmuEUjex0vkM5LVwDTdKN\n z/H8zXvuwNDYKEsPAZevlBLtXAt7FwDIjpauhEdiK8U1rOXwgSxWf1GhxssXJtaXzTgNDOex5of\n v/LG+bPom8immFt0kXRVM/y0/LwkHFcAB5B7AA63bEgBRZJB2NR3/uQjGyyT+wYF5sGH7eRF+o3\n UmRtNAQnpaRAOCtwTuA==","X-Authority-Analysis":"v=2.4 cv=KbXfcAYD c=1 sm=1 tr=0 ts=69c3a287 cx=c_pps\n a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17\n a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=VnNF1IyMAAAA:8\n a=Ef7soKIlfam-QSBKTVMA:9 a=QEXdDO2ut3YA:10","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-03-25_03,2026-03-24_01,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n suspectscore=0 impostorscore=0 malwarescore=0 adultscore=0 clxscore=1015\n priorityscore=1501 bulkscore=0 lowpriorityscore=0 phishscore=0 spamscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603250062","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":"Hi All,\n\nThe following patch is to fix PR122665 has been bootstrapped and regtested on\npowerpc64le-linux.\n\nChanges from V1:\n  * Moved the unspec declarations from vsx.md to rs6000.md, as these\n    will be reused in future RFC implementation.\n\nrs6000: Fix [su]mul_highpart patterns to use unspec [PR122665]\n\nThe existing smul<mode>3_highpart and umul<mode>3_highpart patterns\nincorrectly defined the high-part multiply by shifting both operands\nbefore multiplication. This does not match the semantics of the\ninstructions vmulhs<wd> and vmulhu<wd>, which perform a widened\nmultiplication and then return the high part.\n\nThis patch replaces the incorrect patterns with UNSPEC_VMULHS and\nUNSPEC_VMULHU forms, and updates the predicate to use\naltivec_register_operand, since these instructions accept only\nAltivec registers.\n\n2025-03-25  Jeevitha Palanisamy  <jeevitha@linux.ibm.com>\n\ngcc/\n\tPR target/122665\n\t* config/rs6000/rs6000.md (UNSPEC_VMULHS, UNSPEC_VMULHU): New.\n\t* config/rs6000/vsx.md (smul<mode>3_highpart): Use UNSPEC_VMULHS.\n\t(umul<mode>3_highpart): Use UNSPEC_VMULHU.","diff":"diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md\nindex 3089551552c..a5481df6880 100644\n--- a/gcc/config/rs6000/rs6000.md\n+++ b/gcc/config/rs6000/rs6000.md\n@@ -173,6 +173,8 @@\n    UNSPEC_XXSPLTIW_CONST\n    UNSPEC_FMAX\n    UNSPEC_FMIN\n+   UNSPEC_VMULHS\n+   UNSPEC_VMULHU\n   ])\n \n ;;\ndiff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md\nindex cfad9b8c6d5..f4979e447de 100644\n--- a/gcc/config/rs6000/vsx.md\n+++ b/gcc/config/rs6000/vsx.md\n@@ -6547,25 +6547,19 @@\n    (set_attr \"size\" \"<bits>\")])\n \n (define_insn \"smul<mode>3_highpart\"\n-  [(set (match_operand:VIlong 0 \"vsx_register_operand\" \"=v\")\n-\t(mult:VIlong (ashiftrt\n-\t\t       (match_operand:VIlong 1 \"vsx_register_operand\" \"v\")\n-\t\t       (const_int 32))\n-\t\t     (ashiftrt\n-\t\t       (match_operand:VIlong 2 \"vsx_register_operand\" \"v\")\n-\t\t       (const_int 32))))]\n+  [(set (match_operand:VIlong 0 \"altivec_register_operand\" \"=v\")\n+        (unspec:VIlong [(match_operand:VIlong 1 \"altivec_register_operand\" \"v\")\n+                        (match_operand:VIlong 2 \"altivec_register_operand\" \"v\")]\n+                       UNSPEC_VMULHS))]\n   \"TARGET_POWER10\"\n   \"vmulhs<wd> %0,%1,%2\"\n   [(set_attr \"type\" \"veccomplex\")])\n \n (define_insn \"umul<mode>3_highpart\"\n-  [(set (match_operand:VIlong 0 \"vsx_register_operand\" \"=v\")\n-\t(us_mult:VIlong (ashiftrt\n-\t\t\t  (match_operand:VIlong 1 \"vsx_register_operand\" \"v\")\n-\t\t\t  (const_int 32))\n-\t\t\t(ashiftrt\n-\t\t\t  (match_operand:VIlong 2 \"vsx_register_operand\" \"v\")\n-\t\t\t  (const_int 32))))]\n+  [(set (match_operand:VIlong 0 \"altivec_register_operand\" \"=v\")\n+        (unspec:VIlong [(match_operand:VIlong 1 \"altivec_register_operand\" \"v\")\n+                        (match_operand:VIlong 2 \"altivec_register_operand\" \"v\")]\n+                       UNSPEC_VMULHU))]\n   \"TARGET_POWER10\"\n   \"vmulhu<wd> %0,%1,%2\"\n   [(set_attr \"type\" \"veccomplex\")])\n","prefixes":["V2"]}