Message ID | 20230113175428.1771219-1-stefansf@linux.ibm.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp405153wrt; Fri, 13 Jan 2023 09:57:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXs1KwInvkU1atLZqNcaF71ZXy72Jba2weUcgTQw/1tquO4nyCIWyFfLDHEp2bkk25JUbfS4 X-Received: by 2002:a50:fc14:0:b0:498:e0be:318b with SMTP id i20-20020a50fc14000000b00498e0be318bmr21029985edr.38.1673632650360; Fri, 13 Jan 2023 09:57:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673632650; cv=none; d=google.com; s=arc-20160816; b=qgkq5lL6cV5pDkTtB9Fgl/q6NnkH9nmN7NwhAb/4MGJjUyfo+mw40/dzfNJEBU5J6w FbaipGAaOn+BsP9AhjmUb5WS72Tzlqm6+2AhwCqrjI7LPax3R1dnvXPjw5Blgvc7D5ts xjdQzkzm4391Bi9syq9b+qlyJK7ajCQh/cdBk1VNqZfAYb1vlA3SGUN/LvNHay2LF1Rh Hbb5Amy4o8vejMsyy2h4lIMF2/+fxii4iakC/JZbi9DYaR1OI/V2VvHpBbCRTPCt7GNr 1uurIguzhpBivJ/v5id9n1GxSsNV56V/6RsH7ru3ly7KNmaQbEdJCd4N9kRb6TnW9P/k QVdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:message-id:date:subject:cc:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=VMlBt1u+l/sBumP7beAUHHmsjN7gHQMOh+kICK3pPOM=; b=pRT/91hF4IrS8cTamcili7A0n2pmYx8QwrFLg4w0aRAhF2qUqIwJdqXFxY9oeY3mH9 lMcsMmruld53+o3UcNQYLHpEI4OlO8PFNeVuSJaEdx1EJWBoJvQh/6xq3imYF5srRWAf wPZx4yLoA8EKyrqWUbnPirWUJAH1sxwwEagbqhbBUG7tly+P0fdAiJ8r/8BcWaztwwLA UJEkqJ50nTE0NjuqiB/T0UvYMAzhGmf5UihRWQHcd3Ao6m4ZmGNRuGJxnrgzW6/HdckB gQVusOvQ0l1qMLlMzEfx62RKtjJhtKKOA4WfDrnbdMqssd8kj7+jG/X5V7f6yIn/eUNH GdFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=MMo8y3T8; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t8-20020a05640203c800b004760bbe07b3si18980260edw.312.2023.01.13.09.57.30 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 09:57:30 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=MMo8y3T8; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5B6253858C39 for <ouuuleilei@gmail.com>; Fri, 13 Jan 2023 17:57:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B6253858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673632649; 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=MMo8y3T8LqMutp17P6BGU0FqitmKsMmk9Tm2XwZ/DaUJyXhEASZZmXLaTDdU+JWAS EmHMIAJU6dfidISUEHfVdS08thZ0W1rZHtKzfohzakhswhr1ItcZUtCw9k1KZLBBcJ pRKBi8x2WeX/PUbQRDHiRoTQcp8jxX7vbmY/7+/0= 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754931030388329830?= X-GMAIL-MSGID: =?utf-8?q?1754931030388329830?= |
Series |
IBM zSystems: Fix TARGET_D_CPU_VERSIONS
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
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");