mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] powerpc64le: Add single instruction math functions
Date: Thu, 29 Jun 2017 13:59:26 -0400	[thread overview]
Message-ID: <20170629175926.GF1627@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAGWvnykqTCEt70wRZ7_XacPLaxVN-CFzzs2rcC=t2NejJmvX2w@mail.gmail.com>

On Thu, Jun 29, 2017 at 01:00:51PM -0400, David Edelsohn wrote:
> >> A colleague of mine reminded me that ELFv2 ABI specifies POWER8 as the
> >> minimum hardware (not little-endian).
> >
> > This is a gratuitous requirement and has nothing to do with the
> > meaning of ELFv2 we're using (and likewise not with the gcc
> > --with-abi=elfv2).
> 
> 2.1.1. Processor Architecture
> 
> This ABI is predicated on, at a minimum, Power ISA version 2.7 and
> contains additional implementation characteristics.

Yes, I understand that it's there but this "requirement" is orthogonal
to the actual interface boundaries the ABI defines. ARM's EABI has a
similar gratuitous baseline of v4t; the compiler can satisfy all the
interface boundary requirements even on v4 and probably lower if it
wants to, but nobody has implemented that.

> >> The implementation of ELFv2 can
> >> operate on earlier hardware, but binaries may not be forward
> >> compatible because of VSX.  Because of the calling convention of VSX
> >> registers in ELFv2, the stack may be corrupted if an application built
> >> without VSX support is linked with a library that does support VSX.
> >> One cannot mix and match musl libc built for POWER4 or PPC970 and musl
> >> libc built for POWER7.
> >
> > I don't think this is accurate. If it is then it's a serious bug we
> > need to fix, and it should have been discussed at the time the port
> > was added...
> 
> This is not an implementation detail in the library, it is the calling
> convention in the compilers.
> 
> >
> > Can you provide a citation for the usage of VSX registers in the
> > calling convention, and how you think that affects the stack?
> 
> Table 2.22 Vector Register Roles in Section 2.2.1.1 Register Roles.
> The definition of volatile and non-volatile registers for vector
> registers affects the amount of stack allocated and the saving of
> non-volatile registers.

Are you saying the caller has to allocate space that the callee might
use to preseve call-saved registers it wants to use, and that the
amount saved depends on ISA level? If so I'll look for the associated
logic in GCC and see what it's doing. If that's the case it should be
reserving space regardless of whether it's built for an ISA level with
the registers or not.

> What is the status of the PPC64LE math optimization patch?

It's merged, I just forgot to push. So is the s390x one. Pushing now.

Rich


  reply	other threads:[~2017-06-29 17:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21 14:53 David Edelsohn
2017-06-23 19:35 ` Rich Felker
2017-06-23 19:53   ` David Edelsohn
2017-06-24  0:46     ` A. Wilcox
2017-06-24  0:55       ` Rich Felker
2017-06-24  3:05       ` David Edelsohn
2017-06-24  3:32         ` Rich Felker
2017-06-24  3:38         ` A. Wilcox
2017-06-24 20:53           ` David Edelsohn
2017-06-24 22:44             ` Rich Felker
2017-06-24 23:57             ` A. Wilcox
2017-06-25  0:10               ` Rich Felker
2017-06-25  1:41                 ` Rich Felker
2017-06-29 13:49                 ` David Edelsohn
2017-06-29 16:05                   ` Rich Felker
2017-06-29 17:00                     ` David Edelsohn
2017-06-29 17:59                       ` Rich Felker [this message]
2017-06-30  1:07                         ` David Edelsohn
2017-06-30  2:11                           ` Rich Felker
2017-06-25  3:24               ` David Edelsohn
2017-06-25 14:28                 ` Rich Felker
2017-06-25 14:56                   ` David Edelsohn
2018-09-27 22:53                   ` A. Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170629175926.GF1627@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).