From patchwork Fri Feb 23 09:34:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jeevitha X-Patchwork-Id: 1903201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=WVRw/7Q0; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Th4bs4whdz23l1 for ; Fri, 23 Feb 2024 20:34:49 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D73B4385828C for ; Fri, 23 Feb 2024 09:34:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id DE5743858D1E for ; Fri, 23 Feb 2024 09:34:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DE5743858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=linux.vnet.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DE5743858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708680865; cv=none; b=AhK9K9P/SyQ3QL/WKYtVztcOxEGEtgGfNz4CDurSRBJO7TWNLNrCWNlYs8FXOFR+1TWWAmcMtBk2/uhx8VhQHjL5DlvA066Zz3iwnypVODMjxBu3bT0zf9ULIFU7NsDvhbS2TovBTYCpEhRbCTQTxeKXExzcwYc8qGczCdSdWvw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708680865; c=relaxed/simple; bh=VMWzrAJYMw+6pQuNQjdR4kBdJEPGYrmeP1COfgqrpU0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=MaXvTZsrz4zFXez/EGy5+i0G7lAok77hGrA6dz0Ry8wUA6v7+ngNdK9KwlbqFX5anx73sxIwA+t1FRDv/i6X7SKzJhXOj8Ok2EIjTUKiWDkmjZFRyQhS6N5quTq5oG+fWvEf1S1L0YvJEKFv5YU3mR0Y0ycjE4SE1sKFizd8o8Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41N96Vt3013661; Fri, 23 Feb 2024 09:34:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : references : from : to : cc : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=R/yDlRr3N4gXZS7uxE4J9EYGffND4trkn0VR6k6eZmw=; b=WVRw/7Q09UAEArboUZxjWYmwjAaGPX+cqO6fUI9fpQthj1br1OIqNlUKSkmkAGigMN5x IqODq5QDHwE2WjlZA6lA1rX+DttcyNgkc2zmu7n2gYjXqyWPpUR8Da7GIBoshG3oQ9Kx TreeB9+CtnMG2ILepG/oOeaXnWs7A1LNE1EWvim+4LKmlSBcpYt1K2T59227AC/aYf/J 3glXfTG2O5cnk2+tXoDgr3RvRwJtdtA5UqTO1tlPZ0lUuIlNDN433PxA33NmeYPAOHLf 4QpX9cme6YCqfRQjzH5+zDTkAqq1JunEUtB11g+U32cmJBGmCQP1Lt0D+aEuyT7RLWHq fw== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wer7wrub9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Feb 2024 09:34:20 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41N7WHLo003615; Fri, 23 Feb 2024 09:34:19 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([172.16.1.6]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wb74u4p71-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Feb 2024 09:34:19 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41N9YG7V22479556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Feb 2024 09:34:18 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 553135806C; Fri, 23 Feb 2024 09:34:16 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0DF355803F; Fri, 23 Feb 2024 09:34:15 +0000 (GMT) Received: from [9.109.208.145] (unknown [9.109.208.145]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Fri, 23 Feb 2024 09:34:14 +0000 (GMT) Message-ID: <92507c51-9ff0-4e67-8a6c-7ffb58bc8537@linux.vnet.ibm.com> Date: Fri, 23 Feb 2024 15:04:13 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH] rs6000: Fix issue in specifying PTImode as an attribute [PR106895] Content-Language: en-US References: <9ea38d87-180f-46b5-a723-45061680980f@linux.vnet.ibm.com> From: jeevitha To: GCC Patches , "Kewen.Lin" , Segher Boessenkool Cc: Peter Bergner In-Reply-To: <9ea38d87-180f-46b5-a723-45061680980f@linux.vnet.ibm.com> X-Forwarded-Message-Id: <9ea38d87-180f-46b5-a723-45061680980f@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Ny_a-w0vN7Fir7DGLP3gN9uJe33N_oYo X-Proofpoint-ORIG-GUID: Ny_a-w0vN7Fir7DGLP3gN9uJe33N_oYo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_15,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 adultscore=0 priorityscore=1501 suspectscore=0 spamscore=0 malwarescore=0 impostorscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402230066 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi All, The following patch has been bootstrapped and regtested on powerpc64le-linux. PTImode attribute assists in generating even/odd register pairs on 128 bits. When the user specifies PTImode as an attribute, it breaks because there is no internal type to handle this mode . We have created a tree node with dummy type to handle PTImode. We are not documenting this dummy type since users are not allowed to use this type externally. 2024-02-23 Jeevitha Palanisamy gcc/ PR target/106895 * config/rs6000/rs6000.h (enum rs6000_builtin_type_index): Add fields to hold PTImode type. * config/rs6000/rs6000-builtin.cc (rs6000_init_builtins): Add node for PTImode type. gcc/testsuite/ PR target/106895 * gcc.target/powerpc/pr106895.c: New testcase. diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc index 6698274031b..f553c72779e 100644 --- a/gcc/config/rs6000/rs6000-builtin.cc +++ b/gcc/config/rs6000/rs6000-builtin.cc @@ -756,6 +756,15 @@ rs6000_init_builtins (void) else ieee128_float_type_node = NULL_TREE; + /* PTImode to get even/odd register pairs. */ + intPTI_type_internal_node = make_node(INTEGER_TYPE); + TYPE_PRECISION (intPTI_type_internal_node) = GET_MODE_BITSIZE (PTImode); + layout_type (intPTI_type_internal_node); + SET_TYPE_MODE (intPTI_type_internal_node, PTImode); + t = build_qualified_type (intPTI_type_internal_node, TYPE_QUAL_CONST); + lang_hooks.types.register_builtin_type (intPTI_type_internal_node, + "__dummypti"); + /* Vector pair and vector quad support. */ vector_pair_type_node = make_node (OPAQUE_TYPE); SET_TYPE_MODE (vector_pair_type_node, OOmode); diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 2291fe8d3a3..77bb937a28b 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -2304,6 +2304,7 @@ enum rs6000_builtin_type_index RS6000_BTI_ptr_vector_quad, RS6000_BTI_ptr_long_long, RS6000_BTI_ptr_long_long_unsigned, + RS6000_BTI_PTI, RS6000_BTI_MAX }; @@ -2348,6 +2349,7 @@ enum rs6000_builtin_type_index #define uintDI_type_internal_node (rs6000_builtin_types[RS6000_BTI_UINTDI]) #define intTI_type_internal_node (rs6000_builtin_types[RS6000_BTI_INTTI]) #define uintTI_type_internal_node (rs6000_builtin_types[RS6000_BTI_UINTTI]) +#define intPTI_type_internal_node (rs6000_builtin_types[RS6000_BTI_PTI]) #define float_type_internal_node (rs6000_builtin_types[RS6000_BTI_float]) #define double_type_internal_node (rs6000_builtin_types[RS6000_BTI_double]) #define long_double_type_internal_node (rs6000_builtin_types[RS6000_BTI_long_double]) diff --git a/gcc/testsuite/gcc.target/powerpc/pr106895.c b/gcc/testsuite/gcc.target/powerpc/pr106895.c new file mode 100644 index 00000000000..56547b7fa9d --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr106895.c @@ -0,0 +1,15 @@ +/* PR target/106895 */ +/* { dg-require-effective-target int128 } */ +/* { dg-options "-O2" } */ + +/* Verify the following generates even/odd register pairs. */ + +typedef __int128 pti __attribute__((mode(PTI))); + +void +set128 (pti val, pti *mem) +{ + asm("stq %1,%0" : "=m"(*mem) : "r"(val)); +} + +/* { dg-final { scan-assembler "stq \[123\]?\[02468\]" } } */