From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp001-out.apm-internet.net (smtp001-out.apm-internet.net [85.119.248.222]) by sourceware.org (Postfix) with ESMTPS id 383E23857351 for ; Thu, 29 Sep 2022 18:33:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 383E23857351 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sandoe.co.uk Received: (qmail 24641 invoked from network); 29 Sep 2022 18:33:15 -0000 X-APM-Out-ID: 16644763942463 X-APM-Authkey: 257869/1(257869/1) 18 Received: from unknown (HELO ?192.168.1.95?) (81.138.1.83) by smtp001.apm-internet.net with SMTP; 29 Sep 2022 18:33:15 -0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680] From: Iain Sandoe In-Reply-To: <20220929171858.GZ25951@gate.crashing.org> Date: Thu, 29 Sep 2022 19:33:14 +0100 Cc: "Kewen.Lin" , GCC Patches Content-Transfer-Encoding: quoted-printable Message-Id: References: <9d9f1f43-b528-387d-45a7-1d89400de0fc@linux.ibm.com> <5B4DCBBB-3237-4A9F-ACCA-6669DE6905B8@sandoe.co.uk> <20220928213049.GU25951@gate.crashing.org> <20220929171858.GZ25951@gate.crashing.org> To: Segher Boessenkool X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,KAM_COUK,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP 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: Hi Segher > On 29 Sep 2022, at 18:18, Segher Boessenkool = wrote: >=20 > On Thu, Sep 29, 2022 at 12:04:05AM +0100, Iain Sandoe wrote: >>> On 28 Sep 2022, at 22:30, Segher Boessenkool = wrote: >>> That works on Linux as well. What still does not work is user-mode >>> context switches in 32-bit processes (so setjmp and getcontext = stuff). >>=20 >> AFAIU the Darwin impl. it is the same - the user context only = contains 32b >> register images. >=20 > Huh, I thought Darwin did this properly. >=20 >> Since one can only use the feature between function calls, >=20 > You still have to preserve the non-volatile GPRs. All 64 bits of it. The OS does do that - e.g. on an interrupt .. but AFAIR, the = user-visible mcontext in a 32b process only shows the lower 32 bits. ( i=E2=80=99d better stop making too many assertions here from memory, = ;) ) >> I guess that the >> setjmp/longjmp stuff is not so critical on Darwin***. However, even = being able >> to use 64b insns between calls could give a massive win in allowing, = for >> example, lock-free 64b atomics. >=20 > But that is not how GCC with -mpowerpc64 works: the calling convention > is the usual 32-bit one, but the functions are 64-bit otherwise; it = uses > all 64 bits of GPRs everywhere except in function calls. I think we said the same thing with different words. The CC is unchanged (so that we can only use 64b insns between calls, = since the upper 32b of callee-saved regs are not preserved). cheers Iain