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: 159890 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp2586450vqb; Mon, 30 Oct 2023 17:09:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEo4WUvS1CcvPTmDD0zqWzB9RT0auQSTXQs4ucZlvucys7C0pUqIz9hRu2mbgZh9XPgrmsN X-Received: by 2002:a05:6830:4d7:b0:6c4:eea8:cf13 with SMTP id s23-20020a05683004d700b006c4eea8cf13mr12291690otd.27.1698710968802; Mon, 30 Oct 2023 17:09:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698710968; cv=pass; d=google.com; s=arc-20160816; b=zA5kHTcqJUQswrm+6VREX9qiB1AbEffe1aopeJMoFePhr6HreJPMsmz0U7y2HyyNKp T10zbfTr1D8DAcq/VA3B7DWcJhBtDwM9mr8myTW4uGPTTgdWpPeHhv0mhmezc8bhpdc2 XEKHxHrxsZJ3F/SIbSy/egCqZ4GDvIvYCjSyUSis4Js4DodqNoL82KjWUlZQNdvoojSS O4busAWjbVMf0jD1VvWmZKKv3ntzVltgIxSxHz/pMYIlhbQ17r/Rg+ZqubULL10z6lx3 IVmL0aKk+Vjp5VYoOqcV7sNvYMMa8mu9rmAx4epmlJvjBF5SkoqzdgAEOJisueCuNNLX d9Nw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:date:cc:to:from:subject:message-id:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=fjjzQrLO7CyOTtA3jotCEz0SYz/YOLscQX/U+EAuegQ=; fh=0KqmGbKQ7jadnbD0Sh9Jx4uMPs3jU4Nx5zkusqNz/GU=; b=QCiHH+J3q3M5rfm9IZE5Fn/b4q2QdT2p7xvJmhQ0N8wHKPljnhYM5JlJAQLpxVfwgN 24DXO1zrw+gcBSe9bjyrUuQKM5pSTwnF4cSEXXtutH394X2SmIYvp9/e44W+8lOcAf7w VPghQbKdRqIlAYlWPqV2dx1mS/ynB0xXb6uexxyYV+JOkCU7orq5ybx23iBrZbai4N0d V/nYYPRafQrANy30Qw1X2UKz8fGD13DSYsbz7gmVtafUPFbLJYNJSKt6RqQI4tHqq285 TNiNVu3pkb7UDuzZNd+3KG6E09GCkSvse/ns21+QlHRy4LO85KMGBfhOcUO7Ok5UntTz c18Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=EjbJgVvk; arc=pass (i=1); 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n8-20020a05622a11c800b0041cc54b994bsi113940qtk.749.2023.10.30.17.09.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 17:09: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=@ibm.com header.s=pp1 header.b=EjbJgVvk; arc=pass (i=1); 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 894E03858C54 for ; Tue, 31 Oct 2023 00:09:28 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781227552767867764 X-GMAIL-MSGID: 1781227552767867764 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) {