From patchwork Fri Apr 19 21:18:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Love X-Patchwork-Id: 1925723 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=bqTlBme+; dkim-atps=neutral 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=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 [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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VLnh64QvJz1yZn for ; Sat, 20 Apr 2024 07:23:50 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CE1EF3849ADC for ; Fri, 19 Apr 2024 21:23:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 9FFBB3849ADC for ; Fri, 19 Apr 2024 21:18:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9FFBB3849ADC 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 9FFBB3849ADC Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713561533; cv=none; b=q4bOHia2zNKGJuqIxGVcl991g0R6JDoY7xd2d3HILhtphvG4+RhLb8qLb6eriEiHIUvVTRMvxx4jgQOHPBwYj34SvSOcMUSaRLXSSP5LtPxzrBdn5is8ufxHLYe2+Qj7sS6gZ2oWDGfdbTe8qGdG+3+GUIOAq2Ifhr8NDWt1ZVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713561533; c=relaxed/simple; bh=muztC5K3niZgx/EootK43nxe3xFhpkLzgoLyK5r/bYI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=JJ8vObzIpuiAynmHBtPrcSxNpJvS63ibPh5L8hMmONBJz/iyYE5mi4uqtkyV5mnGV8LRvHayCXbdYleT8CZWBqT2Y6qFkc28QuE2IxgohWKrygQQoRLmaOQG5ZeE4aZyKOhB1orrhn7Xsx07648rzuakIgAzkzLS5nAjYjl+aWg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43JL419H030857; Fri, 19 Apr 2024 21:18:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=xKyu7gpSMOVZ2hw90fzV1A4F9SmOi4v3AEYF+26Dec8=; b=bqTlBme+84BuKAhzMu9M61EeSd5pDvpmBqGgaWWIRpgQ5huuUrmeCEqVuo7R3I16kQtR kEg9eKy0XQbM0Qy3PToRSgThG/sdRLeO/VHuSv3IB6LVAF1hSbmzYwv1L1IrP9LfardK a3lGkd0pa46Yyd7NebUGHqxUcr90T3AS4SjfcvKj8DZQhGCkpQ9kZIJMLRRcIKdopmwx Si5wHi/vSFSEeZ0ozK25Xk6+bRUHuBY0eOPg0Y3AUkx+Rt7yPV0OVIzUBLPqFqF/d9mF Uk5wWk1ciStjIkMI9bT/1z3tiyIN6qB28tF0lVrsDvurFBaSagauyxbwFONnXRYQ2LCd kA== 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 3xm068r0yy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Apr 2024 21:18:47 +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 43JIOQlt027847; Fri, 19 Apr 2024 21:18:47 GMT Received: from smtprelay06.wdc07v.mail.ibm.com ([172.16.1.73]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3xkbmpe35e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Apr 2024 21:18:47 +0000 Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay06.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 43JLIhnE59507018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Apr 2024 21:18:46 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D7A1858052; Fri, 19 Apr 2024 21:18:43 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2CBE35805F; Fri, 19 Apr 2024 21:18:43 +0000 (GMT) Received: from [9.67.133.93] (unknown [9.67.133.93]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Fri, 19 Apr 2024 21:18:43 +0000 (GMT) Message-ID: <3889610b-6342-4145-8b7c-8a0c0b97c78b@linux.ibm.com> Date: Fri, 19 Apr 2024 14:18:42 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 13/13] rs6000, remove vector set and vector init built-ins. Content-Language: en-US To: gcc-patches@gcc.gnu.org, "bergner@linux.ibm.com" , Segher Boessenkool , "Kewen.Lin" References: <6378d560-df55-4b75-be7b-93dc6b85d81a@linux.ibm.com> From: Carl Love In-Reply-To: <6378d560-df55-4b75-be7b-93dc6b85d81a@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: QCTUVsTSZFvxoWX22qoiFqYJPc7StAz9 X-Proofpoint-GUID: QCTUVsTSZFvxoWX22qoiFqYJPc7StAz9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-19_15,2024-04-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 phishscore=0 suspectscore=0 bulkscore=0 adultscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404190165 X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, 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 rs6000, remove vector set and vector init built-ins. The vector init built-ins: __builtin_vec_init_v16qi, __builtin_vec_init_v8hi, __builtin_vec_init_v4si, __builtin_vec_init_v4sf, __builtin_vec_init_v2di, __builtin_vec_init_v2df, __builtin_vec_set_v1ti perform the same operation as initializing the vector in C code. For example: result_v4si = __builtin_vec_init_v4si (1, 2, 3, 4); result_v4si = {1, 2, 3, 4}; These two constructs were tested and verified they generate identical assembly instructions with no optimization and -O3 optimization. The vector set built-ins: __builtin_vec_set_v16qi, __builtin_vec_set_v8hi. __builtin_vec_set_v4si, __builtin_vec_set_v4sf perform the same operation as setting a specific element in the vector in C code. For example: src_v4si = __builtin_vec_set_v4si (src_v4si, int_val, index); src_v4si[index] = int_val; The built-in actually generates more instructions than the inline C code with no optimization but is identical with -O3 optimizations. All of the above built-ins that are removed do not have test cases and are not documented. Built-ins __builtin_vec_set_v1ti __builtin_vec_set_v2di, __builtin_vec_set_v2df are not removed as they are used in function resolve_vec_insert() in file rs6000-c.cc. The built-ins are removed as they don't provide any benefit over just using C code. gcc/ChangeLog: * config/rs6000/rs6000-builtins.def (__builtin_vec_init_v16qi, __builtin_vec_init_v8hi, __builtin_vec_init_v4si, __builtin_vec_init_v4sf, __builtin_vec_init_v2di, __builtin_vec_init_v2df, __builtin_vec_set_v1ti, __builtin_vec_set_v16qi, __builtin_vec_set_v8hi. __builtin_vec_set_v4si, __builtin_vec_set_v4sf, __builtin_vec_set_v2di, __builtin_vec_set_v2df, __builtin_vec_set_v1ti): Remove built-in definitions. --- gcc/config/rs6000/rs6000-builtins.def | 42 ++------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def index 19d05b8043a..d04ad4ce7e5 100644 --- a/gcc/config/rs6000/rs6000-builtins.def +++ b/gcc/config/rs6000/rs6000-builtins.def @@ -1115,37 +1115,6 @@ const signed short __builtin_vec_ext_v8hi (vss, signed int); VEC_EXT_V8HI nothing {extract} - const vsc __builtin_vec_init_v16qi (signed char, signed char, signed char, \ - signed char, signed char, signed char, signed char, signed char, \ - signed char, signed char, signed char, signed char, signed char, \ - signed char, signed char, signed char); - VEC_INIT_V16QI nothing {init} - - const vf __builtin_vec_init_v4sf (float, float, float, float); - VEC_INIT_V4SF nothing {init} - - const vsi __builtin_vec_init_v4si (signed int, signed int, signed int, \ - signed int); - VEC_INIT_V4SI nothing {init} - - const vss __builtin_vec_init_v8hi (signed short, signed short, signed short,\ - signed short, signed short, signed short, signed short, \ - signed short); - VEC_INIT_V8HI nothing {init} - - const vsc __builtin_vec_set_v16qi (vsc, signed char, const int<4>); - VEC_SET_V16QI nothing {set} - - const vf __builtin_vec_set_v4sf (vf, float, const int<2>); - VEC_SET_V4SF nothing {set} - - const vsi __builtin_vec_set_v4si (vsi, signed int, const int<2>); - VEC_SET_V4SI nothing {set} - - const vss __builtin_vec_set_v8hi (vss, signed short, const int<3>); - VEC_SET_V8HI nothing {set} - - ; Cell builtins. [cell] pure vsc __builtin_altivec_lvlx (signed long, const void *); @@ -1292,15 +1261,8 @@ const signed long long __builtin_vec_ext_v2di (vsll, signed int); VEC_EXT_V2DI nothing {extract} - const vsq __builtin_vec_init_v1ti (signed __int128); - VEC_INIT_V1TI nothing {init} - - const vd __builtin_vec_init_v2df (double, double); - VEC_INIT_V2DF nothing {init} - - const vsll __builtin_vec_init_v2di (signed long long, signed long long); - VEC_INIT_V2DI nothing {init} - +;; VEC_SET_V1TI, VEC_SET_V2DF and VEC_SET_V2DI are used in +;; resolve_vec_insert(), rs6000-c.cc const vsq __builtin_vec_set_v1ti (vsq, signed __int128, const int<0,0>); VEC_SET_V1TI nothing {set}