Message ID | 20230113175428.1771219-1-stefansf@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C7EC138493CA for <patchwork@sourceware.org>; Fri, 13 Jan 2023 17:57:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7EC138493CA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673632634; bh=VMlBt1u+l/sBumP7beAUHHmsjN7gHQMOh+kICK3pPOM=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=N4EHbBieizF8PiQ+G+3wPtdCvtqZXkwMxEyiFUf2c4hD3UnPPzJJs5aesjQhZdAwR QjchdsULePc6upd/t3PCgONH9Da/2Gnau6d0JUtXD585J9xxOmeF46iZ5dGmKjTXVa v1Zb0RDn9xt90X8HRZID9gil99MYRx09gB1CdaZM= 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 CC1C63858C39 for <gcc-patches@gcc.gnu.org>; Fri, 13 Jan 2023 17:56:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC1C63858C39 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30DHecAP027614 for <gcc-patches@gcc.gnu.org>; Fri, 13 Jan 2023 17:56:45 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3n38uh57pa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Fri, 13 Jan 2023 17:56:45 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30D8SHmU022358 for <gcc-patches@gcc.gnu.org>; Fri, 13 Jan 2023 17:56:43 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3n1k5ub511-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Fri, 13 Jan 2023 17:56:43 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30DHud2F26346146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jan 2023 17:56:39 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 763FB20043; Fri, 13 Jan 2023 17:56:39 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5552120040; Fri, 13 Jan 2023 17:56:39 +0000 (GMT) Received: from a35lp68.lnxne.boe (unknown [9.152.108.100]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTPS; Fri, 13 Jan 2023 17:56:39 +0000 (GMT) To: krebbel@linux.ibm.com, gcc-patches@gcc.gnu.org Cc: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com> Subject: [PATCH] IBM zSystems: Fix TARGET_D_CPU_VERSIONS Date: Fri, 13 Jan 2023 18:54:29 +0100 Message-Id: <20230113175428.1771219-1-stefansf@linux.ibm.com> X-Mailer: git-send-email 2.39.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: AY2gF84V9DuF91Qb8CJ0eu80e-9DvPXe X-Proofpoint-ORIG-GUID: AY2gF84V9DuF91Qb8CJ0eu80e-9DvPXe Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-13_08,2023-01-13_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 mlxlogscore=999 impostorscore=0 malwarescore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301130118 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Stefan Schulze Frielinghaus via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
IBM zSystems: Fix TARGET_D_CPU_VERSIONS
|
|
Commit Message
Stefan Schulze Frielinghaus
Jan. 13, 2023, 5:54 p.m. UTC
In the context of D the interpretation of S390, S390X, and SystemZ is a bit fuzzy. The wording S390X was wrongly deprecated in favour of SystemZ by commit https://github.com/dlang/dlang.org/commit/3b50a4c3faf01c32234d0ef8be5f82915a61c23f Thus, SystemZ is used for 64-bit targets, now, and S390 for 31-bit targets. However, in TARGET_D_CPU_VERSIONS depending on TARGET_ZARCH we set the CPU version to SystemZ. This is also the case if compiled for 31-bit targets leading to the following error: libphobos/libdruntime/core/sys/posix/sys/stat.d:967:13: error: static assert: '96u == 144u' is false 967 | static assert(stat_t.sizeof == 144); | ^ Thus in order to keep this patch simple I went for keeping SystemZ for 64-bit targets and S390, as usual, for 31-bit targets and dropped the distinction between ESA and z/Architecture. Bootstrapped and regtested on IBM zSystems. Ok for mainline? gcc/ChangeLog: * config/s390/s390-d.cc (s390_d_target_versions): Fix detection of CPU version. --- gcc/config/s390/s390-d.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Comments
Excerpts from Stefan Schulze Frielinghaus via Gcc-patches's message of Januar 13, 2023 6:54 pm: > In the context of D the interpretation of S390, S390X, and SystemZ is a > bit fuzzy. The wording S390X was wrongly deprecated in favour of > SystemZ by commit > https://github.com/dlang/dlang.org/commit/3b50a4c3faf01c32234d0ef8be5f82915a61c23f > Thus, SystemZ is used for 64-bit targets, now, and S390 for 31-bit > targets. However, in TARGET_D_CPU_VERSIONS depending on TARGET_ZARCH we > set the CPU version to SystemZ. This is also the case if compiled for > 31-bit targets leading to the following error: > > libphobos/libdruntime/core/sys/posix/sys/stat.d:967:13: error: static assert: '96u == 144u' is false > 967 | static assert(stat_t.sizeof == 144); > | ^ > So that I follow, there are three possible combinations? ESA 31-bit (S390) ESA 64-bit (what was S390X) z/Arch 64-bit (SystemZ) > Thus in order to keep this patch simple I went for keeping SystemZ for > 64-bit targets and S390, as usual, for 31-bit targets and dropped the > distinction between ESA and z/Architecture. > > Bootstrapped and regtested on IBM zSystems. Ok for mainline? > OK by me. Maybe keep both S390X and SystemZ for TARGET_64BIT? There's only ever been a binary distinction as far as I'm aware. Iain.
On Mon, Jan 23, 2023 at 02:21:46PM +0100, Iain Buclaw wrote: > Excerpts from Stefan Schulze Frielinghaus via Gcc-patches's message of Januar 13, 2023 6:54 pm: > > In the context of D the interpretation of S390, S390X, and SystemZ is a > > bit fuzzy. The wording S390X was wrongly deprecated in favour of > > SystemZ by commit > > https://github.com/dlang/dlang.org/commit/3b50a4c3faf01c32234d0ef8be5f82915a61c23f > > Thus, SystemZ is used for 64-bit targets, now, and S390 for 31-bit > > targets. However, in TARGET_D_CPU_VERSIONS depending on TARGET_ZARCH we > > set the CPU version to SystemZ. This is also the case if compiled for > > 31-bit targets leading to the following error: > > > > libphobos/libdruntime/core/sys/posix/sys/stat.d:967:13: error: static assert: '96u == 144u' is false > > 967 | static assert(stat_t.sizeof == 144); > > | ^ > > > > So that I follow, there are three possible combinations? > > ESA 31-bit (S390) > ESA 64-bit (what was S390X) > z/Arch 64-bit (SystemZ) There are three combinations: - s390: 32-bit ABI and ESA mode - s390: 32-bit ABI and z/Architecture mode - s390x: 64-bit ABI and z/Architecture mode Note, depending on the CPU mode z/Architecture is supported by the 32- and 64-bit ABI whereas ESA is only supported by the 32-bit ABI. Thus, s390 always refers to the 32-bit ABI but does not fix the instructions set architecture (ESA or z/Architecture). Whereas s390x refers to the 64-bit ABI for which only z/Architecture exists. While nitpicking, typically the target is written in lower case letters, i.e., not S390X but s390x and likewise s390 instead of S390. Hope this clarifies the set of possible combinations. Let me know if anything else is unclear. > > > Thus in order to keep this patch simple I went for keeping SystemZ for > > 64-bit targets and S390, as usual, for 31-bit targets and dropped the > > distinction between ESA and z/Architecture. > > > > Bootstrapped and regtested on IBM zSystems. Ok for mainline? > > > > OK by me. Maybe keep both S390X and SystemZ for TARGET_64BIT? There's > only ever been a binary distinction as far as I'm aware. Sounds good to me. I will come up with an updated patch. Cheers, Stefan
diff --git a/gcc/config/s390/s390-d.cc b/gcc/config/s390/s390-d.cc index d10b45f7de4..ced7f49a988 100644 --- a/gcc/config/s390/s390-d.cc +++ b/gcc/config/s390/s390-d.cc @@ -30,10 +30,8 @@ along with GCC; see the file COPYING3. If not see void s390_d_target_versions (void) { - if (TARGET_ZARCH) + if (TARGET_64BIT) d_add_builtin_version ("SystemZ"); - else if (TARGET_64BIT) - d_add_builtin_version ("S390X"); else d_add_builtin_version ("S390");