[PATCH] Compile AVX libm functions with -mavx -mprefer-avx128

H.J. Lu hjl.tools@gmail.com
Tue Oct 2 20:54:00 GMT 2012


On Tue, Oct 2, 2012 at 12:47 PM, Ondřej Bílka <neleai@seznam.cz> wrote:
> On Tue, Oct 02, 2012 at 03:31:50PM -0400, Mike Frysinger wrote:
>> On Tuesday 02 October 2012 15:20:54 H.J. Lu wrote:
>> > On Tue, Oct 2, 2012 at 12:02 PM, Mike Frysinger <vapier@gentoo.org> wrote:
>> > > On Tuesday 02 October 2012 09:53:25 H.J. Lu wrote:
>> > >> This patch compiles AVX libm functions with -mavx.  It reduces text size
>> > >
>> > >> of libm.so by about 1%:
>> > > looks like you're reverting 56f6f6a2403cfa7267cad722597113be35ecf70d.
>> > > shouldn't you revert all of it and not just change the CFLAGS back ?
>> >
>> > Doesn't this patch:
>> >
>> > http://sourceware.org/ml/libc-alpha/2012-10/msg00055.html
>> >
>> > do that?
>>
>> yes, i missed the follow up
>>
>> > > it'd be useful to know *why* Ulrich moved away from -mavx, but
>> > > unfortunately his commit message is useless.
>> >
>> > I can only guess:
>>
>> might be useful to put some notes (like referring to the older commit) into
>> the commit message when you do commit things
>> -mike
>
> could it be a 60 cycle penalty when switching between legagy sse and avx
> state?
>

Here is a patch to compile AVX libm functions with -mavx -mprefer-avx128.


-- 
H.J.
---
	* config.make.in (config-cflags-avx128): New.
	* configure.in (libc_cv_cc_avx128): AC_SUBST.
	* sysdeps/i386/configure.in: Add -mprefer-avx128 check.
	* sysdeps/x86_64/configure.in: Likewise.
	* configure: Regenerated.
	* sysdeps/i386/configure: Likewise.
	* sysdeps/x86_64/configure: Likewise.
	* sysdeps/x86_64/fpu/multiarch/Makefile (CFLAGS-e_atan2-avx.c):
	Set to -mavx -mprefer-avx128 if supported.
	(CFLAGS-e_exp-avx.c): Likewise.
	(CFLAGS-e_log-avx.c): Likewise.
	(CFLAGS-mpa-avx.c): Likewise.
	(CFLAGS-mpexp-avx.c): Likewise.
	(CFLAGS-mplog-avx.c): Likewise.
	(CFLAGS-s_atan-avx.c): Likewise.
	(CFLAGS-s_sin-avx.c): Likewise.
	(CFLAGS-slowexp-avx.c): Likewise.
	(CFLAGS-s_tan-avx.c): Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libc-avx128-1.patch
Type: application/octet-stream
Size: 7793 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20121002/3036e641/attachment.obj>


More information about the Libc-alpha mailing list