From patchwork Mon Feb 26 06:18:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jeevitha X-Patchwork-Id: 86360 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6D04A3858C5E for ; Mon, 26 Feb 2024 06:19:17 +0000 (GMT) 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 CAC073858D3C for ; Mon, 26 Feb 2024 06:18:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CAC073858D3C 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 CAC073858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708928332; cv=none; b=xWMgT+0H1wI88VkwUIqPsFyRAqh0VoHL34EmDlT7svb23+naCIqw/8WEAPhUk7X+TdKt1KAgoyhwUw5/qg2rygtCuY3cvqiZ8VhD0/v7MLN6e52nt2K2SsHSY+1j7mHqfRj1I8jgobX3A3rbq5PVk++SKtDoc08gOXZP3QsZU58= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708928332; c=relaxed/simple; bh=zB6Fd7sWVHPEVhM6SmeUnOkCmOBVxgcXOR1BSTOJkCM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=vBEwmSzEtBBILFId6QyCjnYqpqVrJSoKhC57McU84j6oMa5xzATJR7WJ1f+qSo/k6KCxDpABlbCP9ywP9JRkMWumzKpQMUxCO45MTUj3AqUdaCPrHotkGRvd4/dvBLJyzfkjMSPmBuHk/T3P7UkgiKDKZijNiYx7iS7fhPe3FgE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41Q6B8Ur014278; Mon, 26 Feb 2024 06:18:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : to : from : subject : cc : content-type : content-transfer-encoding; s=pp1; bh=smb+yESuMcLNTlrmMFLbw64Ngr6mGFR4TcC6vzTCMug=; b=D8OERkAwSxnrK4zPczIezlJLrd50ngxYO09sBKwd8m17QUGq6OoVvc0nlhJ/HNlNuRZ4 6JQcqeyl2/J6UrzMzDU7RzNKex1N81OCqNK3LrTonNPgLnxEz0Gpryd4l8droTdtVB+A kz+jO8a+YQjyubV1gvFkHHQ8Rydi4Z30zjHxUEVgUisTOCbCl6u9bR9oMDEP0E0X5Y6M XMFwpTF26azFz084T3W5S28DQ6RBw/F+eX4hoIcv/aHbNsHGh4wkt63IYIP58cwmqaHd p5i0gdfPNofDVRd896iZ8u31V01HY7KcAyZxyE8VetN6U6jFCBrvsfUel2EHOBzK7IbB Dw== 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 3wff3553gv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Feb 2024 06:18:39 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41Q3stUI024144; Mon, 26 Feb 2024 06:18:38 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wfw0jxu2f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Feb 2024 06:18:38 +0000 Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41Q6IZGJ9503740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Feb 2024 06:18:37 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 94CDD58064; Mon, 26 Feb 2024 06:18:35 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E71E958066; Mon, 26 Feb 2024 06:18:32 +0000 (GMT) Received: from [9.109.208.145] (unknown [9.109.208.145]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 26 Feb 2024 06:18:32 +0000 (GMT) Message-ID: <7faaa8f2-d706-4f6a-811f-103b74f2de8a@linux.vnet.ibm.com> Date: Mon, 26 Feb 2024 11:48:31 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: GCC Patches , "Kewen.Lin" , Segher Boessenkool , Michael Meissner From: jeevitha Subject: [PATCH] rs6000: Don't allow immediate value in the vsx_splat pattern [PR113950] Cc: Peter Bergner X-TM-AS-GCONF: 00 X-Proofpoint-GUID: PI8Bwzztwgm5LFTNfXsrtDHmBdms9Zj6 X-Proofpoint-ORIG-GUID: PI8Bwzztwgm5LFTNfXsrtDHmBdms9Zj6 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-26_03,2024-02-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 bulkscore=0 adultscore=0 suspectscore=0 clxscore=1015 mlxscore=0 spamscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=745 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402260046 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+patchwork=sourceware.org@gcc.gnu.org Hi All, The following patch has been bootstrapped and regtested on powerpc64le-linux. There is no immediate value splatting instruction in powerpc. Currently that needs to be stored in a register or memory. For addressing this I have updated the predicate for the second operand in vsx_splat to splat_input_operand, which will handle the operands appropriately. 2024-02-26 Jeevitha Palanisamy gcc/ PR target/113950 * config/rs6000/vsx.md (vsx_splat_): Updated the predicates for second operand. gcc/testsuite/ PR target/113950 * gcc.target/powerpc/pr113950.c: New testcase. diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index 6111cc90eb7..e5688ff972a 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -4660,7 +4660,7 @@ (define_expand "vsx_splat_" [(set (match_operand:VSX_D 0 "vsx_register_operand") (vec_duplicate:VSX_D - (match_operand: 1 "input_operand")))] + (match_operand: 1 "splat_input_operand")))] "VECTOR_MEM_VSX_P (mode)" { rtx op1 = operands[1]; diff --git a/gcc/testsuite/gcc.target/powerpc/pr113950.c b/gcc/testsuite/gcc.target/powerpc/pr113950.c new file mode 100644 index 00000000000..29ded29f683 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr113950.c @@ -0,0 +1,24 @@ +/* PR target/113950 */ +/* { dg-do compile } */ +/* { dg-options "-O1" } */ + +/* Verify we do not ICE on the following. */ + +void abort (void); + +int main () +{ + int i; + vector signed long long vsll_result, vsll_expected_result; + signed long long sll_arg1; + + sll_arg1 = 300; + vsll_expected_result = (vector signed long long) {300, 300}; + vsll_result = __builtin_vsx_splat_2di (sll_arg1); + + for (i = 0; i < 2; i++) + if (vsll_result[i] != vsll_expected_result[i]) + abort(); + + return 0; +}