From patchwork Thu Apr 13 17:58:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Love X-Patchwork-Id: 83051 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1219288vqo; Thu, 13 Apr 2023 10:59:28 -0700 (PDT) X-Google-Smtp-Source: AKy350bk3/HcGOGj2+mTiYswcLl/VSpwE59XfkCguLveRpsaAPp/WK9E1+BR6VEnRoe2R+nEUCsB X-Received: by 2002:aa7:c94c:0:b0:504:8173:ec8c with SMTP id h12-20020aa7c94c000000b005048173ec8cmr3802944edt.13.1681408768262; Thu, 13 Apr 2023 10:59:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681408768; cv=none; d=google.com; s=arc-20160816; b=CHJr2cajRCCdmGrXHE5IFSKnjUvXJ4jY/q0zxbqoBf/e6GTWAbQKudcvtFJwKZynWC 3wxb2U4akDUc2HboAe3uO+vaNuTLzhC5q3TLvcNw+4EKI+TQBlIBA+5Wuaa4xhnQM3/n +P+Oq8NZIrHh2QZX99RO50niKj+WzADg+UobKmc7qiqK3Gu9re+BxzK5svd/10ahbOG8 IEWYxSA6OXBU6QZ/+rqfd+JujJnBq4Ult8009guTzs82+sscL0fy0EKRUOBLXFblRse1 PQOqnD7OvK4X8EmsnIzf5ZgZdZ23rFbEqzDxBdNizl0XLLXY8xk6EhVpLMTaj7h9vdoL VzBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:date:cc:to:subject :message-id:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=vg88HwYEQfNmswiSj//RM1NZUCInDji0EKVO/we0xtM=; b=msKeRiiLzPw54vqy2KQXppKACf/Cls2x7mcA3Z40CWyu/8+STa9HEHrokIG9QSsxbI ix0327pY9QlbD88eZEYfBN1R2pwJRv4Xsq6V0Bhk5uWSEyyaHqUqjMlS8TLOjwif3l/s OJ6SGSg/1VGhyz/r9lRZ/Eli/nzIbDjrBjvsBbq++isCyxGI+y8OZvaBBGEI/fIT8n7d YMMtj87myEbeORjqC/ouXK1wFDKmANhFAM0w82bYvXSsFSIZ9gu08pZiKNLf53v/Rqew SWMjLHNf/R62IJKS0K1NOmySHKj2y/tm3PqTs77H3oZ+pSf1Dx6+3dtZ+tZ53j9zcleu +KbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XxJUESW7; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id f3-20020a05640214c300b00506747f3c05si1735083edx.247.2023.04.13.10.59.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 10:59:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XxJUESW7; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3686F3858408 for ; Thu, 13 Apr 2023 17:59:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3686F3858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681408767; bh=vg88HwYEQfNmswiSj//RM1NZUCInDji0EKVO/we0xtM=; h=Subject:To:Cc:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=XxJUESW7rCR4wdFP0JKtAn9QWJdvJMPei8lKc7DThc/qN3PrDY06MKJgZ713fBoaz y7RfCqkI1yDo09HxWDNSgO8j+8gGo53DeLy/rNUUHlIIBt2Xumzd/fbEg1F2ZRrFES 7s0xVvK9uIFg9sxTwSWhxc74mhnjLOpAQ9hO8ALQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 5CDAE3858D20 for ; Thu, 13 Apr 2023 17:58:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5CDAE3858D20 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33DGl4F9010160; Thu, 13 Apr 2023 17:58:42 GMT Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pxnj82ke0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Apr 2023 17:58:41 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 33DH4h7F020767; Thu, 13 Apr 2023 17:58:41 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([9.208.129.119]) by ppma04wdc.us.ibm.com (PPS) with ESMTPS id 3pu0jhcqdf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Apr 2023 17:58:41 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 33DHwdL823331476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Apr 2023 17:58:39 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1AA35803F; Thu, 13 Apr 2023 17:58:38 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9405C58056; Thu, 13 Apr 2023 17:58:38 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.150.219]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 13 Apr 2023 17:58:38 +0000 (GMT) Message-ID: Subject: [PATCH] rs6000: Fix test int_128bit-runnable.c instruction counts To: gcc-patches@gcc.gnu.org, Segher Boessenkool Cc: cel@us.ibm.com, Peter Bergner Date: Thu, 13 Apr 2023 10:58:38 -0700 X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: G4B2qs8Bw1lMFvqNqz1PJBlc5SM4073i X-Proofpoint-ORIG-GUID: G4B2qs8Bw1lMFvqNqz1PJBlc5SM4073i X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-13_12,2023-04-13_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 phishscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 impostorscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304130155 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Carl Love via Gcc-patches From: Carl Love Reply-To: Carl Love Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763084880836540433?= X-GMAIL-MSGID: =?utf-8?q?1763084880836540433?= GCC maintainers: The following fix updates the expected instruction counts for the test int_128bit-runnable.c test. The counts changed as a result of a commit to support 128-bit integer divide and modulus. The change resulted in two of the tests using vdivsq instructions rather than the vextsd2q instruction. This increased the counts for the vdivsq from 1 to three and the counts for the vextsd2q instruction from 6 to 4. The patch has been tested on a Power10 system with no new regression failures. Please let me know if this patch is acceptable for mainline. Thanks. Carl ---------------------------------------- rs6000: Fix test int_128bit-runnable.c instruction counts The test reports two failures on Power 10LE: FAIL: .../int_128bit-runnable.c scan-assembler-times \\\\mvdivsq\\\\M 1 FAIL: .../int_128bit-runnable.c scan-assembler-times \\\\mvextsd2q\\\\M 6 The current counts are : vdivsq 3 vextsd2q 4 The counts changed with commit: commit 852b11da11a181df517c0348df044354ff0656d6 Author: Michael Meissner Date: Wed Jul 7 21:55:38 2021 -0400 Generate 128-bit int divide/modulus on power10. This patch adds support for the VDIVSQ, VDIVUQ, VMODSQ, and VMODUQ instructions to do 128-bit arithmetic. 2021-07-07 Michael Meissner The code generation changed significantly. There are two places where the vextsd2q is "replaced" by a vdivsq instruction thus increasing the vdivsq count from 1 to 3. The first case is: expected_result = vec_arg1[0]/4; 10000af8: 60 01 df e8 ld r6,352(r31) 10000afc: 68 01 ff e8 ld r7,360(r31) 10000b00: 76 fe e9 7c sradi r9,r7,63 10000b04: 67 4b 00 7c mtvsrdd vs32,0,r9 10000b08: 02 06 1b 10 vextsd2q v0,v0 <---- 10000b0c: 03 00 40 39 li r10,3 10000b10: 00 00 60 39 li r11,0 10000b14: 67 00 09 7c mfvrd r9,v0 10000b18: 67 02 08 7c mfvsrld r8,vs32 10000b1c: 38 50 08 7d and r8,r8,r10 10000b20: 38 58 29 7d and r9,r9,r11 10000b24: 78 4b 2b 7d mr r11,r9 10000b28: 78 43 0a 7d mr r10,r8 10000b2c: 14 30 4a 7f addc r26,r10,r6 10000b30: 14 39 6b 7f adde r27,r11,r7 10000b34: 46 f0 69 7b sldi r9,r27,62 10000b38: 82 f0 58 7b srdi r24,r26,2 10000b3c: 78 c3 38 7d or r24,r9,r24 10000b40: 74 16 79 7f sradi r25,r27,2 10000b44: 30 00 1f fb std r24,48(r31) 10000b48: 38 00 3f fb std r25,56(r31) To: expected_result = vec_arg1[0]/4; 10000af8: 69 01 1f f4 lxv vs32,352(r31) 10000afc: 04 00 20 39 li r9,4 10000b00: 00 00 40 39 li r10,0 10000b04: 67 4b 2a 7c mtvsrdd vs33,r10,r9 10000b08: 0b 09 00 10 vdivsq v0,v0,v1 <---- 10000b0c: 3d 00 1f f4 stxv vs32,48(r31) The second case were a vexts2q instruction is replaced with vdivsq: From: expected_result = arg1/16; 10000c24: 40 00 df e8 ld r6,64(r31) 10000c28: 48 00 ff e8 ld r7,72(r31) 10000c2c: 76 fe e9 7c sradi r9,r7,63 10000c30: 67 4b 00 7c mtvsrdd vs32,0,r9 10000c34: 02 06 1b 10 vextsd2q v0,v0 <--- 10000c38: 0f 00 40 39 li r10,15 10000c3c: 00 00 60 39 li r11,0 10000c40: 67 00 09 7c mfvrd r9,v0 10000c44: 67 02 08 7c mfvsrld r8,vs32 10000c48: 38 50 08 7d and r8,r8,r10 10000c4c: 38 58 29 7d and r9,r9,r11 10000c50: 78 4b 2b 7d mr r11,r9 10000c54: 78 43 0a 7d mr r10,r8 10000c58: 14 30 ca 7e addc r22,r10,r6 10000c5c: 14 39 eb 7e adde r23,r11,r7 10000c60: c6 e0 e9 7a sldi r9,r23,60 10000c64: 02 e1 d4 7a srdi r20,r22,4 10000c68: 78 a3 34 7d or r20,r9,r20 10000c6c: 74 26 f5 7e sradi r21,r23,4 10000c70: 30 00 9f fa std r20,48(r31) 10000c74: 38 00 bf fa std r21,56(r31) To: expected_result = arg1/16; 10000be8: 49 00 1f f4 lxv vs32,64(r31) 10000bec: 10 00 20 39 li r9,16 10000bf0: 00 00 40 39 li r10,0 10000bf4: 67 4b 2a 7c mtvsrdd vs33,r10,r9 10000bf8: 0b 09 00 10 vdivsq v0,v0,v1 <--- 10000bfc: 3d 00 1f f4 stxv vs32,48(r31) The patch has been tested on Power10LE with no regressions. gcc/testsuite/ * gcc.target/powerpc/int_128bit-runnable.c: Update expected instruction counts. --- gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c index 1afb00262a1..b2e2da1e013 100644 --- a/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c +++ b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c @@ -4,7 +4,7 @@ /* Check that the expected 128-bit instructions are generated if the processor supports the 128-bit integer instructions. */ -/* { dg-final { scan-assembler-times {\mvextsd2q\M} 6 } } */ +/* { dg-final { scan-assembler-times {\mvextsd2q\M} 4 } } */ /* { dg-final { scan-assembler-times {\mvslq\M} 2 } } */ /* { dg-final { scan-assembler-times {\mvsrq\M} 2 } } */ /* { dg-final { scan-assembler-times {\mvsraq\M} 2 } } */ @@ -18,7 +18,7 @@ /* { dg-final { scan-assembler-times {\mvmulesd\M} 1 } } */ /* { dg-final { scan-assembler-times {\mvmulosd\M} 1 } } */ /* { dg-final { scan-assembler-times {\mvmulld\M} 1 } } */ -/* { dg-final { scan-assembler-times {\mvdivsq\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mvdivsq\M} 3 } } */ /* { dg-final { scan-assembler-times {\mvdivuq\M} 1 } } */ /* { dg-final { scan-assembler-times {\mvdivesq\M} 1 } } */ /* { dg-final { scan-assembler-times {\mvdiveuq\M} 1 } } */