From patchwork Fri Aug 2 06:01:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 1968155 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=ouUi9+iX; 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 4WZwG66mB5z1yYq for ; Fri, 2 Aug 2024 16:02:05 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EFE1A385DDC4 for ; Fri, 2 Aug 2024 06:02:02 +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 F20A73858D26 for ; Fri, 2 Aug 2024 06:01:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F20A73858D26 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 F20A73858D26 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=1722578502; cv=none; b=gvAcfAYuFqTDZ/pXcPdNqy/mZCBbskFzLEVgfH4maKp5frrPQ3+UEf23yy52g7hMBu5RICYugitUzM70osYzDU1SN24Jry5Fpwf3lB4ZsKkGprGp9+1nRRG+cuavGmayIQMyjLI+Dp/dkB7j36Zppxa4/bBSUBPpTWcJAMzzX7s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722578502; c=relaxed/simple; bh=rD4t+h+W0bm7mSYwM07rtXbZtqB213E3sHt6/5VfVn0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=ESP+pdjCvuhjaYRVid72IeO3SVMWlnFPVP8SPx14jS48JgwerdhMEDYqc+6jP2lcll52UrcDTBL4kAcKjYhoB/Fs+iCKUMPoH1y3gyLvr0awUGKvpUJooXkCZwMYbjPw+mlmUicHvjAaNJk5OayUlgWnxDdasq1zrOwo8Ud4HA4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4724wW3A031474; Fri, 2 Aug 2024 06:01:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date :from:to:subject:message-id:mime-version:content-type; s=pp1; bh=qSEnDE+5FjlY30bw+pmNuDDGbND1i55lm/lOagEWmBM=; b=ouUi9+iXIgiq YjMjLl6aLyVe9pKIzCRU8CnDKtDrMsuS0goqUgpmG2TOyPfD7F5RcD7CRBG0v4bq dZBIROkhW8/Pe0asIMkvM9YJuqrxVAmDSYZo4aAqpwCw9RkITi+lMqWcLuE/pMJw yhbXin4G/+vx2BbF854wxUTbHuKo1qmfgT/QU+Uniz21uL2WPxXVTUgUEpcLm8VJ 4Z0OPlgW3j3pHh5WVtHGMk6pspd1ql5bhMnHSM+qOrwl0vyofksRoYj5rSNd+Jcr 3rSBt5MMVVYU3zCpVu9R8NFMZoOEvh66M19JLiGLOHjd2mM8EPD0O1RbHYZwpt8Z lkq2Xxyiqg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 40rp8vgbvd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Aug 2024 06:01:39 +0000 (GMT) Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 47261cAR021454; Fri, 2 Aug 2024 06:01:38 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 40rp8vgbvb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Aug 2024 06:01:38 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 4722A19k029118; Fri, 2 Aug 2024 06:01:38 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 40nbm15w9w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Aug 2024 06:01:38 +0000 Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 47261YHL29295190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 2 Aug 2024 06:01:36 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 841BD58062; Fri, 2 Aug 2024 06:01:34 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B34158056; Fri, 2 Aug 2024 06:01:34 +0000 (GMT) Received: from cowardly-lion.the-meissners.org (unknown [9.61.67.12]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTPS; Fri, 2 Aug 2024 06:01:33 +0000 (GMT) Date: Fri, 2 Aug 2024 02:01:29 -0400 From: Michael Meissner To: gcc-patches@gcc.gnu.org, Michael Meissner , Segher Boessenkool , "Kewen.Lin" , David Edelsohn , Peter Bergner Subject: [PATCH 0/9] Adding PowerPC architecture flags in addition to ISA flags Message-ID: Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , "Kewen.Lin" , David Edelsohn , Peter Bergner MIME-Version: 1.0 Content-Disposition: inline X-TM-AS-GCONF: 00 X-Proofpoint-GUID: LkIvLxUbL4YRwb_VvEeq9FMtce4aQe9b X-Proofpoint-ORIG-GUID: fa8jm6BDB9f5efUWVn8tS1etRXK3BWOt 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-08-02_02,2024-08-01_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxlogscore=373 spamscore=0 suspectscore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408020039 X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, 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 I wrote these patches after submitting the power11 patches. For a long time, one of the issues with the PowerPC port has been internally we use an ISA option to denote a specific power architecture level. For example: -mpopcntb means the target is at least a power5 system -mfprnd means the target is at least a power5+ system -mcmpb means the target is at least a power6 system -mpopcntd means the target is at least a power7 system -mmodulo means the target is at least a power9 system Several times we have needed to add support for an architecture in general, but we don't have a specific new ISA flag for the architecture. This means we have to add undocumented ISA options in order to set an ISA flag. We then have to mark the option so that the user should not use these options. -mpower8-internal means the target is at least a power8 system -mpower10 means the target is at least a power10 system -mpower11 means the target is at least a power11 system Instead of using these ISA switches, the user should use the appropriate -mcpu= and -mtune= options, and let the compiler enable all of the appropriate options. As needed, the user can use the ISA options to restrict the code generation (for example using -mno-vsx). So these patches are a general cleanup to move the hardware options that aren't an ISA option into a separate hardware. It also will change the GCC compiler so that it now uses TARGET_POWER7 instead of TARGET_POPCNTD. In addition, these patches also change the behavior of the GCC compiler so that -mvsx does not automatically raise a default build to target power7 and later. This shows up on big endian systems where the default cpu for GCC is power4. Parts of this issue shows up in building the IEEE 128-bit floating point support on systems that do not support VSX, which is needed for IEEE 128-bit floating point. PRs target/115800 and target/113652 have been raised for problems caused in building GCC on some systems and I have submitted patches for libgfortran and libstdc++-v3 (basically on these patches, if the compiler does not support IEEE 128-bit by default, do not build the IEEE 128-bit support). The patches in this set of patches will now give an error if you use -mvsx when the default cpu is not at least power7. The patches in this set are: #1 This patch adds support for the architecture flags. It also moves the target_clones support to use the architecture flags. For the power processors, the .machine directive now uses the architecture flags. #2 This patch removes -mpower8-internal, -mpower10, and -mpower11 from being ISA flag bits, and the appropriate support uses the architecture flag bits. #3 This patch prevents newer ISA options from implicitly raising the CPU. In particular, it prevents -mvsx from being used if the processor does not support VSX (i.e. power7 or newer). #4 This patch changes most uses of TARGET_POPCNTB to TARGET_POWER5. In places where the code is explicitly about the popcount instruction, I did not change the references. #5 This patch changes TARGET_FPRND to TARGET_POWER5X. #6 This patch changes TARGET_CMPB to TARGET_POWER6. #7 This patch changes TARGET_POPCNTD to TARGET_POWER7, except in the places where the code explicitly handles the popcount instruction. #8 This patch changes TARGET_MODULO to TARGET_POWER9, except in the places where the code explicitly handles the modulo instruction. #9 This patch fixes the two tests that needed to use -mcpu= to use an option like -mvsx. I have built both big endian and little endian bootstrap compilers and there were no regressions. In addition, I constructed a test case that used every archiecture define (like _ARCH_PWR4, etc.) and I also looked at the .machine directive generated. I ran this test for all supported combinations of -mcpu, big/little endian, and 32/64 bit support. Every single instance generated exactly the same code with the patches installed compared to the compiler before installing the patches. Can I install these nine patches on the GCC 15 trunk?