From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 612913858D32 for ; Fri, 15 Jul 2022 21:22:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 612913858D32 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26FLC0jX018899; Fri, 15 Jul 2022 21:22:48 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hbfxf867k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Jul 2022 21:22:47 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 26FLDsZG000312; Fri, 15 Jul 2022 21:22:47 GMT Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hbfxf867c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Jul 2022 21:22:47 +0000 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 26FLLZ4w010138; Fri, 15 Jul 2022 21:22:46 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma02wdc.us.ibm.com with ESMTP id 3h71aa3d6n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Jul 2022 21:22:46 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 26FLMjT816581564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Jul 2022 21:22:45 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AD176AC05B; Fri, 15 Jul 2022 21:22:45 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 45358AC059; Fri, 15 Jul 2022 21:22:45 +0000 (GMT) Received: from lexx (unknown [9.160.8.243]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 15 Jul 2022 21:22:45 +0000 (GMT) Message-ID: <1445b2c5f69e136556798fcf2c5895952eab1517.camel@vnet.ibm.com> Subject: Re: [PATCH, rs6000] Additional cleanup of rs6000_builtin_mask From: will schmidt To: "Kewen.Lin" Cc: Segher Boessenkool , David Edelsohn , GCC Patches Date: Fri, 15 Jul 2022 16:22:13 -0500 In-Reply-To: <260e72ce-0bd9-da43-3920-260c827f174f@linux.ibm.com> References: <260e72ce-0bd9-da43-3920-260c827f174f@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: YvrJ4zf9ZTpPe7r-Asd0gXfbVoEVQVjm X-Proofpoint-GUID: V0k9qYAsyCWygdCOHlekvExtNRQ0OOrC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-15_13,2022-07-15_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 mlxscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 priorityscore=1501 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207150093 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, RCVD_IN_MSPIKE_H2, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2022 21:22:51 -0000 On Thu, 2022-07-14 at 11:28 +0800, Kewen.Lin wrote: > Hi Will, > > Thanks for the cleanup! Some comments are inlined. Hi, Thanks for the review. A few comments and responses below. TLDR I'll incorporate the suggestions in V2 that will show up ... after. :-) > > on 2022/7/14 05:39, will schmidt wrote: > > [PATCH, rs6000] Additional cleanup of rs6000_builtin_mask > > > > Hi, > > Post the rs6000 builtins rewrite, some of the leftover builtin > > code is redundant and can be removed. > > This replaces the remaining usage of bu_mask in > > rs6000_target_modify_macros() with checks against the rs6000_cpu > > directly. > > Thusly the bu_mask variable can be removed. After that variable > > is eliminated there are no other uses of > > rs6000_builtin_mask_calculate(), > > so that function can also be safely removed. > > > > The TargetVariable rs6000_builtin_mask in rs6000.opt is useless, it > seems > it can be removed together? Yes, if I also remove usage of x_rs6000_builtin_mask. There are a few remaining reference to x_r_b_m, but those appear safe to remove after this cleanup as well. I'll confirm and likely include the removal in V2. > > > I have tested this on current systems (P8,P9,P10) without > > regressions. > > > > OK for trunk? > > > > > > Thanks, > > -Will > > > > > > > > - /* Set the builtin mask of the various options used that could > > affect which > > - builtins were used. In the past we used target_flags, but > > we've run out > > - of bits, and some options are no longer in target_flags. */ > > - rs6000_builtin_mask = rs6000_builtin_mask_calculate (); > > - if (TARGET_DEBUG_BUILTIN || TARGET_DEBUG_TARGET) > > - rs6000_print_builtin_options (stderr, 0, "builtin mask", > > - rs6000_builtin_mask); > > - > > I wonder if it's a good idea to still dump some information for > built-in > functions debugging even with new bif framework, it can be handled in > a > separated patch if yes. The new bif framework adopts stanzas for bif > guarding, if we want to do similar things, we can refer to the code > like: > TARGET_POPCNTB means all bifs with ENB_P5 are available > TARGET_CMPB means all bifs with ENB_P6 are available > ... > > , dump information like "current enabled stanzas: ENB_xx, ENB_xxx, > ..." > (even without ENB_ prefix). Possibly. There does exist some debug already, and I still have some work in progress related to some of the OPTION and TARGET handling. I'll keep this in mind as I continue poking in this space. :-) > > /* Initialize all of the registers. */ > > rs6000_init_hard_regno_mode_ok (global_init_p); > > > > /* Save the initial options in case the user does function > > specific options */ > > if (global_init_p) > > @@ -24495,17 +24442,15 @@ rs6000_pragma_target_parse (tree args, > > tree pop_target) > > > > if ((diff_flags != 0) || (diff_bumask != 0)) > > { > > /* Delete old macros. */ > > rs6000_target_modify_macros_ptr (false, > > - prev_flags & diff_flags, > > - prev_bumask & diff_bumask); > > + prev_flags & diff_flags); > > > > /* Define new macros. */ > > rs6000_target_modify_macros_ptr (true, > > - cur_flags & diff_flags, > > - cur_bumask & diff_bumask); > > + cur_flags & diff_flags); > > } > > } > > > > return true; > > } > > @@ -24732,19 +24677,10 @@ rs6000_print_isa_options (FILE *file, int > > indent, const char *string, > > rs6000_print_options_internal (file, indent, string, flags, "- > > m", > > &rs6000_opt_masks[0], > > ARRAY_SIZE (rs6000_opt_masks)); > > } > > > > -static void > > -rs6000_print_builtin_options (FILE *file, int indent, const char > > *string, > > - HOST_WIDE_INT flags) > > -{ > > - rs6000_print_options_internal (file, indent, string, flags, "", > > - &rs6000_builtin_mask_names[0], > > - ARRAY_SIZE > > (rs6000_builtin_mask_names)); > > -} > > rs6000_builtin_mask_names becomes useless too, can be removed too? It can. I'll include removal in V2. Thanks -Will > > BR, > Kewen