Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 10 Jun 2017 20:29:50 +0200
From: Szabolcs Nagy <>
Cc: David Edelsohn <>
Subject: Re: [PATCH] s390x: Add single instruction math functions

* David Edelsohn <> [2017-06-10 13:25:00 -0400]:
> On Sat, Jun 10, 2017 at 11:36 AM, Szabolcs Nagy <> wrote:
> > * David Edelsohn <> [2017-06-09 10:51:25 -0400]:
> >> The following patch is a start at single instruction math functions
> >> for s390x architecture to increase performance.
> >
> > looks good, i wonder why gcc does not have builtins support for
> > ceil, floor, nearbyint, round and trunc
> >
> > (on aarch64 the builtins expand to single instruction with
> > -fno-math-errno, but on s390x they remain libc calls
> Both the functions and builtins are converted to single instructions
> for me.  What architecture level is your GCC assuming?

i think it's the default s390x config

$ s390x-linux-musl-gcc -v
Using built-in specs.
Target: s390x-linux-musl
Configured with: ../src_toolchain/configure --enable-languages=c,c++ CFLAGS='-g0 -Os' CXXFLAGS='-g0 -Os' LDFLAGS=-s --disable-nls --with-debug-prefix-map=/home/nsz/w/mcm/build-s390x-linux-musl= --enable-languages=c,c++ --disable-libquadmath --disable-libquadmath-support --disable-decimal-float --disable-multilib --disable-libcilkrts --disable-libvtv --disable-libgomp --disable-libitm --disable-werror --target=s390x-linux-musl --prefix= --libdir=/lib --disable-multilib --with-sysroot=/s390x-linux-musl --enable-tls --disable-libmudflap --disable-libsanitizer --disable-gnu-indirect-function --disable-libmpx --enable-libstdcxx-time --with-build-sysroot=/home/nsz/w/mcm/build-s390x-linux-musl/obj_sysroot
Thread model: posix
gcc version 6.3.0 (GCC) 
$ cat a.c
double f(double x)
	return __builtin_ceil(x);
$ s390x-linux-musl-gcc -O3 -fno-math-errno -S a.c -o -
	.machinemode zarch
	.machine "z900"
	.align	8
.globl f
	.type	f, @function
	jg	ceil
	.size	f, .-f
	.ident	"GCC: (GNU) 6.3.0"
	.section	.note.GNU-stack,"",@progbits

> > at some point we plan to have some internal header to turn
> > math/string calls into builtins when compiling musl with gcc)
> I have a patch set ready for powerpc64 teed up after this patch.
> Thanks, David

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.