From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] s390x: Add single instruction math functions
Date: Tue, 20 Jun 2017 21:20:24 -0400 [thread overview]
Message-ID: <20170621012024.GF1627@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAGWvny=1ePv4yGG63i1ezOLhU5Ou7RCq59P6EpvzLNrwWA_q1A@mail.gmail.com>
On Tue, Jun 20, 2017 at 09:07:08PM -0400, David Edelsohn wrote:
> Rich,
>
> Another option is a test recommended by a colleague
>
> #if (__HTM__ || __ARCH__ > z196)
>
> __HTM__ is defined in earlier releases of GCC and is enabled in zEC12,
> so it can be used as a proxy for the architecture in earlier compiler
> releases.
>
> Would that be acceptable?
Indeed, __HTM__ gets defined for me on gcc 6.3 with -march=zEC12 but
not with -march=z196. If that's acceptable to you I think it's okay;
users could also build with "-march=z196 -D__ARCH__=???" to get the
math insns on baseline z196. BTW what is the actual value for __ARCH__
indicating z196? I think I figured it out from the gcc source as 10.
The "z196" you used in the above example isn't really a macro, is it?
If so that's a bad namespace violation in gcc that needs to be
fixed...
Rich
> On Tue, Jun 20, 2017 at 8:49 PM, Rich Felker <dalias@libc.org> wrote:
> > On Sun, Jun 18, 2017 at 01:12:15PM -0400, David Edelsohn wrote:
> >> How can we move forward with this patch?
> >>
> >> I would prefer to avoid the __ARCH__ complexity until there is a clear
> >> user requirement.
> >>
> >> Thanks, David
> >
> > Rob Landley informed me that the s390x environment he's building with
> > mkroot (https://github.com/landley/mkroot) for testing under qemu
> > system level emulation is running a kernel built for z900. If qemu can
> > emulate newer machines, this may just be an oversight that can be
> > changes by reconfiguring, but it does indicate that z900 seems to be
> > supported by kernel, and that there's at least someone using the
> > baseline ISA level now.
> >
> > For what it's worth I agree that we've spent an inordinate amount of
> > time on this topic, and I apologize. I just don't want it to turn into
> > a regression.
> >
> > Rich
> >
> >
> >> On Wed, Jun 14, 2017 at 7:44 PM, Rich Felker <dalias@libc.org> wrote:
> >> > On Mon, Jun 12, 2017 at 09:28:52AM -0400, David Edelsohn wrote:
> >> >> >> The following IBM table of supported and tested systems
> >> >> >>
> >> >> >> https://www-03.ibm.com/systems/z/os/linux/resources/testedplatforms.html
> >> >> >>
> >> >> >> shows that RHEL 7 and SLES 12 require at least z196, and Ubuntu 16.04
> >> >> >> requires at least zEC12.
> >> >> >>
> >> >> >> I can't find any official hardware requirements description for Alpine
> >> >> >> Linux. I tend to doubt that user would run it on older hardware,
> >> >> >> especially hardware no longer supported by other, modern Linux
> >> >> >> distributions.
> >> >> >>
> >> >> >> Building musl libc on older hardware is a nice accomplishment, but
> >> >> >> investing effort and complexity to maintain support probably isn't
> >> >> >> useful to any musl libc user and probably isn't a productive use of
> >> >> >> developer resources.
> >> >> >>
> >> >> >> I will continue to inquire if there is a simple technique to accomplish this.
> >> >>
> >> >> Apparently GCC 7.1 added architecture macros.
> >> >>
> >> >> As Tuan referenced, Alpine Linux also requires z196 as the minimum
> >> >> architecture level. I believe that it would be better for s390-musl
> >> >> to default to z196 ISA than musl to require GCC 7.1.
> >> >
> >> > I agree we shouldn't "require GCC 7.1", but using the macros does not
> >> > imply such a requirement. For example:
> >> >
> >> > #if __ARCH__ >= 10
> >> >
> >> > would only use the asm on z196+ (if I got the number right) with GCC
> >> > 7.1+ (no asm on older compilers), whereas:
> >> >
> >> > #if __ARCH__ >= 10 || !defined(__ARCH__)
> >> >
> >> > would use the asm on z196+ or on compilers too old to provide __ARCH__
> >> > (and building for a more minimal baseline ISA would not be supported
> >> > on such compilers unless you manually add -D__ARCH__=5 or whatever to
> >> > CFLAGS).
> >> >
> >> > I'm fine with waiting to add those pp conditionals until if/when
> >> > someone actually wants to use the lower baseline ISA, if you don't
> >> > want to do it now. I am hesitant to add new ISA-forcing logic to
> >> > configure, though (see the other reply on that). Would it be bad to
> >> > have the build fail with low default -march? If so, maybe the
> >> > configure logic could check for !defined(__ARCH__) and then do a
> >> > compile test to define __ARCH__ on its own, and we could use the above
> >> > logic?
> >> >
> >> > Rich
next prev parent reply other threads:[~2017-06-21 1:20 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-09 14:51 David Edelsohn
2017-06-10 15:36 ` Szabolcs Nagy
2017-06-10 17:25 ` David Edelsohn
2017-06-10 18:29 ` Szabolcs Nagy
2017-06-10 18:53 ` David Edelsohn
2017-06-10 19:48 ` Rich Felker
2017-06-10 20:22 ` David Edelsohn
2017-06-10 21:28 ` Szabolcs Nagy
2017-06-10 21:44 ` David Edelsohn
2017-06-10 21:48 ` David Edelsohn
2017-06-11 2:20 ` Rich Felker
2017-06-11 10:19 ` Szabolcs Nagy
2017-06-11 15:04 ` Rich Felker
2017-06-11 16:45 ` Szabolcs Nagy
2017-06-11 21:45 ` Rich Felker
2017-06-12 2:46 ` David Edelsohn
2017-06-12 4:36 ` Tuan M. Hoang
2017-06-12 9:03 ` Szabolcs Nagy
2017-06-12 13:28 ` David Edelsohn
2017-06-12 13:54 ` David Edelsohn
2017-06-12 20:28 ` Szabolcs Nagy
2017-06-12 21:02 ` David Edelsohn
2017-06-13 15:55 ` Szabolcs Nagy
2017-06-14 23:34 ` Rich Felker
2017-06-14 23:40 ` A. Wilcox
2017-06-14 23:44 ` Rich Felker
2017-06-15 12:18 ` David Edelsohn
2017-06-18 17:12 ` David Edelsohn
2017-06-21 0:49 ` Rich Felker
2017-06-21 1:07 ` David Edelsohn
2017-06-21 1:20 ` Rich Felker [this message]
2017-06-21 3:34 ` David Edelsohn
2017-06-23 19:31 ` Rich Felker
2017-06-10 21:37 ` Rich Felker
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=20170621012024.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).