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: 1768586 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=Os5HHUKE; dkim-atps=neutral Received: from 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Py6lY5s7Mz1yZk for ; Fri, 14 Apr 2023 03:59:04 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 537693858C66 for ; Thu, 13 Apr 2023 17:59:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 537693858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681408742; 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=Os5HHUKEUdx4qQ3qxlQeBfyD1BshS7vmAw+vSfMBzTwaLIEw0bTTmrkQqU6eQTLH2 a9prMyOfA7Am3dX5k7CSgXczGhZ62If6n7VceGf73iq13ew2sb6HQX4sIXBrnj8HCz sVBd9pjAByxcip8iput3Y1yOVGhvc1JpxLw4ht0c= 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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 } } */