From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 75A0C3858C60 for ; Thu, 8 Feb 2024 20:11:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 75A0C3858C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 75A0C3858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=63.228.1.57 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707423080; cv=none; b=nDIrh/tGSeh9+BhlC9MXr7EdFo7tzzLDz/9FkkcO74s9xbLEDSm7AURch1tx6waNMXAZ4JZwBPJJYcq5Xz/LpygjkpPoaorrEC0mwolc3NQYAyWr1m2ZMbEU2fVX/9GLN2/1Ho4pI2aEVZGQCQxG5DJgQkx4vHreCOsYutjIPso= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707423080; c=relaxed/simple; bh=g0C2qcKrDWJgDp4AYNXcljYO1gQk+DKhJwndKJwQH+c=; h=Date:From:To:Subject:Message-ID:Mime-Version; b=BlFyxd/lzmy+MDdb8bfyD5QU5B3Uaa4XmmTpaNOxG8a2sYVB2jpjGWoIj32YmPGxdlFBLtoczPtY7/K4muOXGRS3SRZm0LOtlB7BUt2ZdRFDTCPtLV4sl1mXBsb6cKdRiIru3mhhY1TG9LPpOxg1ZIZAQHd2XG1v9Wp2VMO8u24= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 418KAH0r023852; Thu, 8 Feb 2024 14:10:17 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 418KAHUe023845; Thu, 8 Feb 2024 14:10:17 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 8 Feb 2024 14:10:17 -0600 From: Segher Boessenkool To: Michael Meissner , gcc-patches@gcc.gnu.org, "Kewen.Lin" , David Edelsohn , Peter Bergner Subject: Re: Repost [PATCH 1/6] Add -mcpu=future Message-ID: <20240208201017.GV19790@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Jan 05, 2024 at 06:35:37PM -0500, Michael Meissner wrote: > * config/rs6000/rs6000.opt (-mfuture): New undocumented debug switch. No. Never ever use a flag that does what -mcpu= should do. We're still trying to recover from previous such mistakes. Don't add more please. > +++ b/gcc/config/rs6000/rs6000-c.cc > @@ -447,6 +447,8 @@ rs6000_target_modify_macros (bool define_p, HOST_WIDE_INT flags) > rs6000_define_or_undefine_macro (define_p, "_ARCH_PWR9"); > if ((flags & OPTION_MASK_POWER10) != 0) > rs6000_define_or_undefine_macro (define_p, "_ARCH_PWR10"); > + if ((flags & OPTION_MASK_FUTURE) != 0) > + rs6000_define_or_undefine_macro (define_p, "_ARCH_PWR_FUTURE"); if ((((a & B) != 0) != 0) != 0) ? You can do just if (a & B) Yes, existing code already does the silly thing, but just fix it then, don't add more :-) (And no if ((a & B)) either please). > +static int > +rs600_cpu_index_lookup (enum processor_type processor) > +{ > + for (size_t i = 0; i < ARRAY_SIZE (processor_target_table); i++) > + if (processor_target_table[i].processor == processor) > + return i; > + > + return -1; > +} "int i" please, not "size_t". This has nothing to do with object sizes. The loop counter will always be a small number. > + /* At the moment, we don't have explict -mtune=future support. If the user "At the moment" is out of date almost as soon as you write it. It is better to avoid such terms ;-) > + explicitly tried to use -mtune=future, give a warning. If not, use the > + power10 tuning until future tuning is added. */ There should be Power11 tuning now, please use that? So please post this -- as a separate series, and not as a single patch -- after fixing the things Ke Wen pointed out. Thanks! Segher