From patchwork Mon Jul 8 06:24:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1957812 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=njpe7jhb; 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 4WHYxt2vNbz1xr9 for ; Mon, 8 Jul 2024 16:24:50 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 69BBA3861022 for ; Mon, 8 Jul 2024 06:24:48 +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 02E48385E82F for ; Mon, 8 Jul 2024 06:24:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 02E48385E82F 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 02E48385E82F 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=1720419870; cv=none; b=P5f9GT6WdBEpu5UjecYuatVRTNQY9et4+1eUREsFFiHqf3+99sx9FcdsqXk+2Pa4Cv1s/iSlrGs/+YWVMdAoFibGgeMu7yee+34pFg0XRFFQeW46QuDE5fSrMoiHLUV/W89yEY3IRqRUBh6TUDKqZUl2sE3J88szjSJfPzYU+fI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720419870; c=relaxed/simple; bh=4fy4nVm1iXaoD9djSdtUxz0KUXQi0XCwgaUTbcU+n2U=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=egcQ+c8kGNE33JGGRzRX+VKWsb85vWKnNh9R2oJ2yMXDofTrKEtRslsDuNAFCZzctbqZOjeyZNQgnN3uQTM73fPuk6swZgR7CI7kJlgtymoWyaAxCRVxb8K8zfcJ5K56R03dmS1/5dwGjrycuPz0f4TvadOal0iF0xu70eAAPY0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4685T8va021293; Mon, 8 Jul 2024 06:24:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h= message-id:date:mime-version:from:subject:to:cc:content-type :content-transfer-encoding; s=pp1; bh=tVKFehDaWZQ8AXhqjzLWXmLCGE 5z7wmM1MKvdzOIvE0=; b=njpe7jhbFF1EugQsvY4ibSxpP5ts9flz9VJ+YHjUzk tfAmSHZF0em2hmB0Yzv4Tea/+Hbp8AGgJxEef8QDKITQrmYTGrd5yAsD0k1Y9XIl 5l8IaD7FGNyXtHFthM8TLfNxMmMHyQJQ9cIJCH2wLg9XWgnpK1BPom7VMpSOP6rx FSf85noY/cEzr0lQ6imCziZygGOyXZXCyEFZgvaj1wSk3QHRjLmQNwt3U3yyymLB X2ZPnjkKR86IXfYWTBJ806y2CknpDB8Un38Sm9D8pQdMgMXqtpOxjZknM1vSswD9 q80WBgBxKL3xPigbaS1+MFY1cw36HXfc2PmM5k8LjZnw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 407pnqj08x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Jul 2024 06:24:26 +0000 (GMT) Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4686MhYM004072; Mon, 8 Jul 2024 06:24:26 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 407pnqj08t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Jul 2024 06:24:25 +0000 (GMT) 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 4682Bq1a006967; Mon, 8 Jul 2024 06:24:25 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 407jfm58bc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Jul 2024 06:24:24 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4686OLjA42402180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Jul 2024 06:24:23 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3AE9720043; Mon, 8 Jul 2024 06:24:21 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 53CFF20040; Mon, 8 Jul 2024 06:24:19 +0000 (GMT) Received: from [9.200.52.232] (unknown [9.200.52.232]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 8 Jul 2024 06:24:18 +0000 (GMT) Message-ID: <851d9721-620e-701f-d100-f12852a80922@linux.ibm.com> Date: Mon, 8 Jul 2024 14:24:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Content-Language: en-US From: "Kewen.Lin" Subject: [PATCH] rs6000: Remove vcond{,u} expanders To: GCC Patches Cc: Segher Boessenkool , David Edelsohn , Peter Bergner , Richard Biener X-TM-AS-GCONF: 00 X-Proofpoint-GUID: --7fuMGZsXHEvfBpgc5l6rPBBQdiEgYF X-Proofpoint-ORIG-GUID: 99lM4d9iKnQuqCUQuLY6pV0REnQSqTjv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-08_02,2024-07-05_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 spamscore=0 phishscore=0 mlxscore=0 bulkscore=0 adultscore=0 suspectscore=0 mlxlogscore=954 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407080048 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, 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 Hi, As PR114189 shows, middle-end will obsolete vcond, vcondu and vcondeq optabs soon. This patch is to remove all vcond{,u} expanders in rs6000 port and adjust the function rs6000_emit_vector_cond_expr which is called by those expanders as static. Bootstrapped and regtested on powerpc64-linux-gnu P8/P9 and powerpc64le-linux-gnu P9 and P10. I'm going to push this later this week if no objections. BR, Kewen ----- gcc/ChangeLog: * config/rs6000/rs6000-protos.h (rs6000_emit_vector_cond_expr): Remove. * config/rs6000/rs6000.cc (rs6000_emit_vector_cond_expr): Add static qualifier as it is only called by rs6000_emit_swsqrt now. * config/rs6000/vector.md (vcond): Remove. (vcond): Remove. (vcondv4sfv4si): Likewise. (vcondv4siv4sf): Likewise. (vcondv2dfv2di): Likewise. (vcondv2div2df): Likewise. (vcondu): Likewise. (vconduv4sfv4si): Likewise. (vconduv2dfv2di): Likewise. --- gcc/config/rs6000/rs6000-protos.h | 1 - gcc/config/rs6000/rs6000.cc | 2 +- gcc/config/rs6000/vector.md | 160 ------------------------------ 3 files changed, 1 insertion(+), 162 deletions(-) ;; Same mode for condition true/false values and predicate operand. -- 2.39.1 diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h index 09a57a806fa..b40557a8557 100644 --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h @@ -126,7 +126,6 @@ extern void rs6000_emit_dot_insn (rtx dst, rtx src, int dot, rtx ccreg); extern bool rs6000_emit_set_const (rtx, rtx); extern bool rs6000_emit_cmove (rtx, rtx, rtx, rtx); extern bool rs6000_emit_int_cmove (rtx, rtx, rtx, rtx); -extern int rs6000_emit_vector_cond_expr (rtx, rtx, rtx, rtx, rtx, rtx); extern void rs6000_emit_minmax (rtx, enum rtx_code, rtx, rtx); extern void rs6000_expand_atomic_compare_and_swap (rtx op[]); extern rtx swap_endian_selector_for_mode (machine_mode mode); diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 58553ff66f4..24044f3a558 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -16145,7 +16145,7 @@ rs6000_emit_vector_compare (enum rtx_code rcode, OP_FALSE are two VEC_COND_EXPR operands. CC_OP0 and CC_OP1 are the two operands for the relation operation COND. */ -int +static int rs6000_emit_vector_cond_expr (rtx dest, rtx op_true, rtx op_false, rtx cond, rtx cc_op0, rtx cc_op1) { diff --git a/gcc/config/rs6000/vector.md b/gcc/config/rs6000/vector.md index 59489e06839..0d3e0a24e11 100644 --- a/gcc/config/rs6000/vector.md +++ b/gcc/config/rs6000/vector.md @@ -331,166 +331,6 @@ (define_expand "vector_copysign3" }) -;; Vector comparisons -(define_expand "vcond" - [(set (match_operand:VEC_F 0 "vfloat_operand") - (if_then_else:VEC_F - (match_operator 3 "comparison_operator" - [(match_operand:VEC_F 4 "vfloat_operand") - (match_operand:VEC_F 5 "vfloat_operand")]) - (match_operand:VEC_F 1 "vfloat_operand") - (match_operand:VEC_F 2 "vfloat_operand")))] - "VECTOR_UNIT_ALTIVEC_OR_VSX_P (mode)" -{ - if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], - operands[3], operands[4], operands[5])) - DONE; - else - gcc_unreachable (); -}) - -(define_expand "vcond" - [(set (match_operand:VEC_I 0 "vint_operand") - (if_then_else:VEC_I - (match_operator 3 "comparison_operator" - [(match_operand:VEC_I 4 "vint_operand") - (match_operand:VEC_I 5 "vint_operand")]) - (match_operand:VEC_I 1 "vector_int_reg_or_same_bit") - (match_operand:VEC_I 2 "vector_int_reg_or_same_bit")))] - "VECTOR_UNIT_ALTIVEC_OR_VSX_P (mode)" -{ - if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], - operands[3], operands[4], operands[5])) - DONE; - else - gcc_unreachable (); -}) - -(define_expand "vcondv4sfv4si" - [(set (match_operand:V4SF 0 "vfloat_operand") - (if_then_else:V4SF - (match_operator 3 "comparison_operator" - [(match_operand:V4SI 4 "vint_operand") - (match_operand:V4SI 5 "vint_operand")]) - (match_operand:V4SF 1 "vfloat_operand") - (match_operand:V4SF 2 "vfloat_operand")))] - "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode) - && VECTOR_UNIT_ALTIVEC_P (V4SImode)" -{ - if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], - operands[3], operands[4], operands[5])) - DONE; - else - gcc_unreachable (); -}) - -(define_expand "vcondv4siv4sf" - [(set (match_operand:V4SI 0 "vint_operand") - (if_then_else:V4SI - (match_operator 3 "comparison_operator" - [(match_operand:V4SF 4 "vfloat_operand") - (match_operand:V4SF 5 "vfloat_operand")]) - (match_operand:V4SI 1 "vint_operand") - (match_operand:V4SI 2 "vint_operand")))] - "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode) - && VECTOR_UNIT_ALTIVEC_P (V4SImode)" -{ - if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], - operands[3], operands[4], operands[5])) - DONE; - else - gcc_unreachable (); -}) - -(define_expand "vcondv2dfv2di" - [(set (match_operand:V2DF 0 "vfloat_operand") - (if_then_else:V2DF - (match_operator 3 "comparison_operator" - [(match_operand:V2DI 4 "vint_operand") - (match_operand:V2DI 5 "vint_operand")]) - (match_operand:V2DF 1 "vfloat_operand") - (match_operand:V2DF 2 "vfloat_operand")))] - "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DFmode) - && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DImode)" -{ - if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], - operands[3], operands[4], operands[5])) - DONE; - else - gcc_unreachable (); -}) - -(define_expand "vcondv2div2df" - [(set (match_operand:V2DI 0 "vint_operand") - (if_then_else:V2DI - (match_operator 3 "comparison_operator" - [(match_operand:V2DF 4 "vfloat_operand") - (match_operand:V2DF 5 "vfloat_operand")]) - (match_operand:V2DI 1 "vint_operand") - (match_operand:V2DI 2 "vint_operand")))] - "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DFmode) - && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DImode)" -{ - if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], - operands[3], operands[4], operands[5])) - DONE; - else - gcc_unreachable (); -}) - -(define_expand "vcondu" - [(set (match_operand:VEC_I 0 "vint_operand") - (if_then_else:VEC_I - (match_operator 3 "comparison_operator" - [(match_operand:VEC_I 4 "vint_operand") - (match_operand:VEC_I 5 "vint_operand")]) - (match_operand:VEC_I 1 "vector_int_reg_or_same_bit") - (match_operand:VEC_I 2 "vector_int_reg_or_same_bit")))] - "VECTOR_UNIT_ALTIVEC_OR_VSX_P (mode)" -{ - if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], - operands[3], operands[4], operands[5])) - DONE; - else - gcc_unreachable (); -}) - -(define_expand "vconduv4sfv4si" - [(set (match_operand:V4SF 0 "vfloat_operand") - (if_then_else:V4SF - (match_operator 3 "comparison_operator" - [(match_operand:V4SI 4 "vint_operand") - (match_operand:V4SI 5 "vint_operand")]) - (match_operand:V4SF 1 "vfloat_operand") - (match_operand:V4SF 2 "vfloat_operand")))] - "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode) - && VECTOR_UNIT_ALTIVEC_P (V4SImode)" -{ - if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], - operands[3], operands[4], operands[5])) - DONE; - else - gcc_unreachable (); -}) - -(define_expand "vconduv2dfv2di" - [(set (match_operand:V2DF 0 "vfloat_operand") - (if_then_else:V2DF - (match_operator 3 "comparison_operator" - [(match_operand:V2DI 4 "vint_operand") - (match_operand:V2DI 5 "vint_operand")]) - (match_operand:V2DF 1 "vfloat_operand") - (match_operand:V2DF 2 "vfloat_operand")))] - "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DFmode) - && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DImode)" -{ - if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], - operands[3], operands[4], operands[5])) - DONE; - else - gcc_unreachable (); -}) - ;; To support vector condition vectorization, define vcond_mask and vec_cmp.