From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11604 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] powerpc64le: Add single instruction math functions Date: Sat, 24 Jun 2017 21:41:51 -0400 Message-ID: <20170625014151.GB1627@brightrain.aerifal.cx> References: <20170623193533.GO1627@brightrain.aerifal.cx> <594DB66E.7030009@adelielinux.org> <594DDEC6.8030200@adelielinux.org> <594EFC63.3000707@adelielinux.org> <20170625001024.GA1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1498354927 5618 195.159.176.226 (25 Jun 2017 01:42:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Jun 2017 01:42:07 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-11617-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jun 25 03:42:03 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dOwYq-00011P-7m for gllmg-musl@m.gmane.org; Sun, 25 Jun 2017 03:42:00 +0200 Original-Received: (qmail 5591 invoked by uid 550); 25 Jun 2017 01:42:03 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5566 invoked from network); 25 Jun 2017 01:42:02 -0000 Content-Disposition: inline In-Reply-To: <20170625001024.GA1627@brightrain.aerifal.cx> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11604 Archived-At: On Sat, Jun 24, 2017 at 08:10:24PM -0400, Rich Felker wrote: > On Sat, Jun 24, 2017 at 06:57:23PM -0500, A. Wilcox wrote: > > Except Adélie, Sabotage, and anyone who is creating their own > > environment without using a distribution. Or are you saying that GCC > > assumes LE with ELFv2? > > > > That is the primary reason I haven't shipped any PPC64 image yet. In > > addition to the usual badness of porting an entire distro worth of > > packages to a platform nobody has really used yet (had a similar time > > with musl on MIPS64 and 32-bit PowerPC), I'm a bit uneasy on the > > toolchain itself being able to understand what Rich has said. Since > > ELFv2 says that Power8 is the minimum ISA, gcc can do whatever it > > wants, and I'm not sure if -mcpu=power6 (specific lower ISA) or > > - -mcpu=powerpc64 (generic) will affect its code output when it sees > > - -mabi=elfv2. So I'm going to need to put any PPC64 image through a > > much more rigorous test than I did any other platform. > > I don't see any reason GCC would introduce a problem here. It should > always honor -march, and the default -march for the > powerpc64-linux-musl (elfv2 of course) toolchain I just built seems to > be POWER4 according to the predefined macros. I just did a quick review (grep -r ELFv2 gcc/config/rs6000) and I don't see anything that would cause gcc to generate code for a different isa level than it otherwise would. The option purely controls the calling convention and related issues. One unfortunate thing I did discover in the process is that neither powerpc64 ABI admits sibcall (tail call) to a function that's not local (static or hidden/protected). This is a consequence of the ABI GOT register being call-preserved rather than call-clobbered. This is a common design issue (mistake IMO) affecting several archs, including SH in the default ABI (but not in the FDPIC ABI, which made the choice to change the GOT register to call-clobbered). Rich