From patchwork Tue Oct 31 00:08:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Love X-Patchwork-Id: 1857281 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=EjbJgVvk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4SK9VR5lpdz1yQ4 for ; Tue, 31 Oct 2023 11:09:18 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E2A5A3858CD1 for ; Tue, 31 Oct 2023 00:09:15 +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 9B5613858D1E for ; Tue, 31 Oct 2023 00:09:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B5613858D1E 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 9B5613858D1E 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=1698710943; cv=none; b=G6BwcP/qJLkht8EYwJHoyU3c64EqtqWyhjrLzxuhz02vOzXcx57PafVTSXaCe6lkUgeEaWpY4IRKaslvpLP14PYMq0fjbTkNpXLsaD0jxcj1KKdThoxkYna1nRfDUVTnAXsagQmkvJqbPs7+8UZY2RnNNi87JOxxQo9qLYOMR7A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698710943; c=relaxed/simple; bh=nkH8t74cle/DOyIfe4g2XFAjPP6BLIj6Bl2tatUwUM0=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:Mime-Version; b=ovvAS+Jw2a8IM7vE0HZNpokYjEjM6/YOXS/32Mly3qW4oIKiyaH8GAKvNQo+gJRKlHN40+x6TmF6McZVkyPGpQo9gpOpG46f4577wv9dtkH5Wj9JAL5Okb0NWiYGH1MgTqIaPsibEnUMGdiJSsx9+0IsSAG1egUZbJgjm9zHFf0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39UNRXwr032756; Tue, 31 Oct 2023 00:09:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : content-type : mime-version : content-transfer-encoding; s=pp1; bh=fjjzQrLO7CyOTtA3jotCEz0SYz/YOLscQX/U+EAuegQ=; b=EjbJgVvkhLnz52prn4zFB3Xd0mibNII3YcoKZFSypnLMXr3rhJ0AurR+usmn0Ox5zLy5 /BzCtBAVlEGWSGd9EQTUANHy8K3NuzxLFYegTnbbCf0DvEvWZT10X9iAu9iBgiUPXFud sgaItrf6TvImddjPYoOpyRVrw85xdIsPVKiwnrgx2ZW7tvuqjVWR6ocd/2PHhgsJ625a 0Ma/ghsbaajHkxtn9DzX1QcJ6500spzhKvczs1fQAGiOFnWsaJnTfuckcinxqq2bWCTQ d/QVI/rxjf2WS3+28VhXM7QMBlk9sIiLmgYXCQ/MDZmawpKzFFKxrOzHHepMv0UZmQmf SA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u2p5xrrbj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Oct 2023 00:09:00 +0000 Received: from m0353727.ppops.net (m0353727.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39V08xjR012812; Tue, 31 Oct 2023 00:08:59 GMT 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 3u2p5xrrb8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Oct 2023 00:08:59 +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 39UKulxW011307; Tue, 31 Oct 2023 00:08:58 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3u1eujv92k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Oct 2023 00:08:58 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39V08wSA17695428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 Oct 2023 00:08:58 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4526F58055; Tue, 31 Oct 2023 00:08:58 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 51CAA58043; Tue, 31 Oct 2023 00:08:57 +0000 (GMT) Received: from wecm-9-67-110-146.wecm.ibm.com (unknown [9.67.110.146]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 31 Oct 2023 00:08:57 +0000 (GMT) Message-ID: Subject: [PATCH] rs6000, Add missing overloaded bcd builtin tests From: Carl Love To: Segher Boessenkool , gcc-patches@gcc.gnu.org, "Kewen.Lin" , David Edelsohn Cc: Peter Bergner , cel@linux.ibm.com Date: Mon, 30 Oct 2023 17:08:56 -0700 X-Mailer: Evolution 3.28.5 (3.28.5-22.el8) Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: SkE3wZNFukv7My23a4btfgk_LoyQJojQ X-Proofpoint-ORIG-GUID: hkytxZYEupMNiMZj_E0VtI8Wid2qkAf_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-30_13,2023-10-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 adultscore=0 clxscore=1011 impostorscore=0 mlxscore=0 malwarescore=0 mlxlogscore=685 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2310300189 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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.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 GCC maintainers: The following patch adds tests for two of the rs6000 overloaded built- ins that do not have tests. Additionally the GCC documentation file doc/extend.texi is updated to include the built-in definitions as they were missing. The patch has been tested on a Power 10 system with no regressions. Please let me know if this patch is acceptable for mainline. Carl ------------------------------------------- rs6000, Add missing overloaded bcd builtin tests The two BCD overloaded built-ins __builtin_bcdsub_ge and __builtin_bcdsub_le do not have a corresponding test. Add tests to existing test file and update the documentation with the built-in definitions. gcc/ChangeLog: * doc/extend.texi (__builtin_bcdsub_le, __builtin_bcdsub_ge): Add documentation for the builti-ins. gcc/testsuite/ChangeLog: * bcd-3.c (do_sub_ge, do_suble): Add functions to test builtins __builtin_bcdsub_ge and __builtin_bcdsub_le). --- gcc/doc/extend.texi | 4 ++++ gcc/testsuite/gcc.target/powerpc/bcd-3.c | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index cf0d0c63cce..fa7402813e7 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -20205,12 +20205,16 @@ int __builtin_bcdadd_ov (vector unsigned char, vector unsigned char, const int); vector __int128 __builtin_bcdsub (vector __int128, vector __int128, const int); vector unsigned char __builtin_bcdsub (vector unsigned char, vector unsigned char, const int); +int __builtin_bcdsub_le (vector __int128, vector __int128, const int); +int __builtin_bcdsub_le (vector unsigned char, vector unsigned char, const int); int __builtin_bcdsub_lt (vector __int128, vector __int128, const int); int __builtin_bcdsub_lt (vector unsigned char, vector unsigned char, const int); int __builtin_bcdsub_eq (vector __int128, vector __int128, const int); int __builtin_bcdsub_eq (vector unsigned char, vector unsigned char, const int); int __builtin_bcdsub_gt (vector __int128, vector __int128, const int); int __builtin_bcdsub_gt (vector unsigned char, vector unsigned char, const int); +int __builtin_bcdsub_ge (vector __int128, vector __int128, const int); +int __builtin_bcdsub_ge (vector unsigned char, vector unsigned char, const int); int __builtin_bcdsub_ov (vector __int128, vector __int128, const int); int __builtin_bcdsub_ov (vector unsigned char, vector unsigned char, const int); @end smallexample diff --git a/gcc/testsuite/gcc.target/powerpc/bcd-3.c b/gcc/testsuite/gcc.target/powerpc/bcd-3.c index 7948a0c95e2..9891f4ff08e 100644 --- a/gcc/testsuite/gcc.target/powerpc/bcd-3.c +++ b/gcc/testsuite/gcc.target/powerpc/bcd-3.c @@ -3,7 +3,7 @@ /* { dg-require-effective-target powerpc_p8vector_ok } */ /* { dg-options "-mdejagnu-cpu=power8 -O2" } */ /* { dg-final { scan-assembler-times "bcdadd\[.\] " 4 } } */ -/* { dg-final { scan-assembler-times "bcdsub\[.\] " 4 } } */ +/* { dg-final { scan-assembler-times "bcdsub\[.\] " 6 } } */ /* { dg-final { scan-assembler-not "bl __builtin" } } */ /* { dg-final { scan-assembler-not "mtvsr" } } */ /* { dg-final { scan-assembler-not "mfvsr" } } */ @@ -93,6 +93,26 @@ do_sub_gt (vector_128_t a, vector_128_t b, int *p) return ret; } +vector_128_t +do_sub_ge (vector_128_t a, vector_128_t b, int *p) +{ + vector_128_t ret = __builtin_bcdsub (a, b, 0); + if (__builtin_bcdsub_ge (a, b, 0)) + *p = 1; + + return ret; +} + +vector_128_t +do_sub_le (vector_128_t a, vector_128_t b, int *p) +{ + vector_128_t ret = __builtin_bcdsub (a, b, 0); + if (__builtin_bcdsub_le (a, b, 0)) + *p = 1; + + return ret; +} + vector_128_t do_sub_ov (vector_128_t a, vector_128_t b, int *p) {