| Message ID | ec0812b0-867b-41d4-b3c2-385c6039efc4@linux.ibm.com |
|---|---|
| State | New |
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5CCEF4BA2E24 for <patchwork@sourceware.org>; Thu, 16 Jul 2026 16:47:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CCEF4BA2E24 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=DBhvlNW1 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 46AF04BA23C9 for <gcc-patches@gcc.gnu.org>; Thu, 16 Jul 2026 16:46:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 46AF04BA23C9 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 46AF04BA23C9 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784220400; cv=none; b=LglLCM7Cwh29hssyJepzUEc1BTfy+510tRDwoO2Dr8Y6KzhbDzcZg6AgFEQ96+3zTSZEDlzWzsKFxzu4rj85iLiAjkIwqaYWwEsyHWNjSAqetdOPmP4Is7jMOxbdeEN8axryibnZIlnKRUzQE9VRthCauaQJyTHALqOAIfHgrck= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784220400; c=relaxed/simple; bh=12xLzzW6DeRPYlMqye3KNBtmliBUr1VsFQdXQ3gaRMk=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=e5huUvpH4UQOWEF7dqsUYgIhJgoDGbYsALeBsixQJAp/KkukYxHyfM/6bAkcYhXarD9OwBlxtpBOm9mWkJeMpZCkFme5HcP8O25FjksWTNP3o3aPjAirbCwVPaPvXTmL0omk6CioNYLH4z/0RLAU89ms3jHxc3zGq2oMe/NDcHc= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=DBhvlNW1 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46AF04BA23C9 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66GGfjaR3754109; Thu, 16 Jul 2026 16:46:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=Szy1bl l7/XwZG1bh7OQUke5/cOW1rtuKLiob/9u5rOI=; b=DBhvlNW1SrAN0c3rH4xadY whMPfG6OFuPmslJlz8MAAZFidjphtmWYQwYY5u9r2Icwq1Pv6W0/Hlq0c7tyQyb9 TCEtu5bajEaf9907pOeB7KFH6TOrGM6DlRPzM8eho6w5JLsWvj+Yx8frtbjk35R6 8A20KmUcvpWZkukZEWxsn3BIEYxVl7qNOmeLW2ayMPtCiF4T2k0upieJUI4GsqK+ Ys9Qi2cxq9HLXdhJctw+iVBGQahI7OIWl+EIK5LWZ2hlu4W3N2P6RGGuOkgBTsBx t9zdONj2jFbOQqmvlC+foqmEXFbAlGIO3fODwcWhMrxdjjn8V3uJSq1LOopfJ7tQ == Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fbepxsyr8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Jul 2026 16:46:38 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 66GGZ75W005671; Thu, 16 Jul 2026 16:46:38 GMT Received: from smtprelay06.wdc07v.mail.ibm.com ([172.16.1.73]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fc2cgnpxd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Jul 2026 16:46:38 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay06.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 66GGka5O31130156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jul 2026 16:46:36 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 87B7A5805F; Thu, 16 Jul 2026 16:46:36 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2DD5C5805A; Thu, 16 Jul 2026 16:46:33 +0000 (GMT) Received: from [9.39.31.139] (unknown [9.39.31.139]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 16 Jul 2026 16:46:32 +0000 (GMT) Message-ID: <ec0812b0-867b-41d4-b3c2-385c6039efc4@linux.ibm.com> Date: Thu, 16 Jul 2026 22:16:30 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH V2 2/12] rs6000: Add %W print modifier From: jeevitha <jeevitha@linux.ibm.com> To: Surya Kumari Jangala <jskumari@linux.ibm.com>, GCC Patches <gcc-patches@gcc.gnu.org>, Michael Meissner <meissner@linux.ibm.com>, Segher Boessenkool <segher@kernel.crashing.org>, Kishan Parmar <kishan@linux.ibm.com>, Vijay Telidevulapalli <vijay@linux.ibm.com>, Manjunath S Matti <mmatti@linux.ibm.com>, Avinash Jayakar <avinashd@linux.ibm.com> References: <15c45257-20d7-4f7c-8f7a-86ec682ac863@linux.ibm.com> <fbe5f78b-06ba-41f5-8f50-0cbee17e5cd3@linux.ibm.com> Content-Language: en-US In-Reply-To: <fbe5f78b-06ba-41f5-8f50-0cbee17e5cd3@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: nkkRUFG-C49wmh4fdhnPCQecti131xFd X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDE3MSBTYWx0ZWRfX4ITbebxUJVvA KGobIT81s5cwEg9pqwKhR85ojlbFbOSq+ef06o/gJ3cdj30Mky2dDNlm6zHIs8rWb/ns6bXGo5x BnnNCFMKGqcvuLbLS4uul3K9G237cDA= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDE3MSBTYWx0ZWRfX/TuwAb77A6PA INQIlzVG99Zvhcz2RxI90TuZwvJUVzBEZ0wJ8la3ipVtlVL/u6VlkgUsMAKPGWseYHnt8OVPZG0 X+GcLtNuZBFY3iRqZhisThyhjth2d+ojLI9JAzQJJwBSEsjH8djaq5pkmZ7PiBbrzt9upEvCUA7 bVm7jZloyoxAoUc4y6xzZVdBsM7gkFpqiIjS+zEnSJJ8BBMRWtnASGq225s7dWdTg/aW/invr0U lVXNkjCM0fTQoOI5IkiPhtzVWnO+Jy6BR228zUYHJ//ctVS6pay/khp31lOoSz8ETZrOOK8V+rC ob17/9CfE8T33KvyL7zWHQ5Pll1me77XvApfww5zylN/5dgYSxB+rcmZA55CCf1vVNlMbBoDfYU NY6p/mC4mCNyU6xcTTdTPtZn7j9SCbgF9H1rlZPenxYI70OO9BG1iyBNJtfxWLSZiNjMzw6EAsr /YxK1treSZ3NJ5hqtWQ== X-Authority-Analysis: v=2.4 cv=XbS5Co55 c=1 sm=1 tr=0 ts=6a590aef cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=Ozf5_aWm9p5jaDdTFxcA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-ORIG-GUID: nkkRUFG-C49wmh4fdhnPCQecti131xFd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-16_06,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 malwarescore=0 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607160171 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org 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>, <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>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
| Series |
None
|
|
Commit Message
jeevitha
July 16, 2026, 4:46 p.m. UTC
Hi All, The following patch has been bootstrapped and regtested on powerpc64le-linux. changes form v1: * Moved the case 'W' below 'w'. Add a new %W print modifier to print_operand that prints the VSX register number plus two. Some future Power instruction patterns require printing two VSX registers corresponding to a __vector_pair operand. The existing %x print modifier emits the first VSX register using VSX register numbering. Add a new %W print modifier to emit the second VSX register of the pair. 2025-07-16 Jeevitha Palanisamy <jeevitha@linux.ibm.com> Kishan Parmar <kishan@linux.ibm.com> gcc/ * config/rs6000/rs6000.cc (print_operand): Add the `%W` print modifier to print the VSX register number plus two.
Comments
On Thu, Jul 16, 2026 at 10:16:30PM +0530, jeevitha wrote: > Hi All, > > The following patch has been bootstrapped and regtested on powerpc64le-linux. > > changes form v1: > * Moved the case 'W' below 'w'. > > Add a new %W print modifier to print_operand that prints the VSX > register number plus two. > > Some future Power instruction patterns require printing two VSX > registers corresponding to a __vector_pair operand. The existing > %x print modifier emits the first VSX register using VSX register > numbering. Add a new %W print modifier to emit the second VSX > register of the pair. > > 2025-07-16 Jeevitha Palanisamy <jeevitha@linux.ibm.com> > Kishan Parmar <kishan@linux.ibm.com> > > gcc/ > * config/rs6000/rs6000.cc (print_operand): Add the `%W` > print modifier to print the VSX register number plus two. This is fine for the master branch and back port to GCC 16.x.
On Thu, Jul 16, 2026 at 10:16:30PM +0530, jeevitha wrote: > Hi All, > > The following patch has been bootstrapped and regtested on powerpc64le-linux. > > changes form v1: > * Moved the case 'W' below 'w'. > > Add a new %W print modifier to print_operand that prints the VSX > register number plus two. > > Some future Power instruction patterns require printing two VSX > registers corresponding to a __vector_pair operand. The existing > %x print modifier emits the first VSX register using VSX register > numbering. Add a new %W print modifier to emit the second VSX > register of the pair. All of these patches are cleared to be back ported to the GCC 16 branch after a short delay to make sure the master branch was not broken, given they only modify PowerPC specific files or documentation files.
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 7743c9cdc4a..3a7327a68c6 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -14516,6 +14516,30 @@ print_operand (FILE *file, rtx x, int code) print_operand (file, x, 0); return; + case 'W': + /* Like '%x', but prints the VSX register number +2. + TODO: Validate %W operands (e.g. reject V30/V31 to avoid referencing + invalid registers). Ensure GET_MODE_SIZE (GET_MODE (x)) >= 64 + before using %W. */ + if (!REG_P (x) || !VSX_REGNO_P (REGNO (x))) + output_operand_lossage ("invalid %%W value"); + else + { + int reg = REGNO (x); + int vsx_reg = (FP_REGNO_P (reg) + ? reg - 32 + : reg - FIRST_ALTIVEC_REGNO + 32); + vsx_reg += 2; + +#ifdef TARGET_REGNAMES + if (TARGET_REGNAMES) + fprintf (file, "%%vs%d", vsx_reg); + else +#endif + fprintf (file, "%d", vsx_reg); + } + return; + case 'x': /* X is a FPR or Altivec register used in a VSX context. */ if (!REG_P (x) || !VSX_REGNO_P (REGNO (x)))