This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] x86-64: Compile branred.c with -mprefer-vector-width=128
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 10 Jun 2019 15:45:37 +0000
- Subject: Re: [PATCH] x86-64: Compile branred.c with -mprefer-vector-width=128
- References: <CAMe9rOoP_293SM=sYpuqx5Yg9K1a-F9GtN6g0DDFjHTZM5OkcA@mail.gmail.com>
On Fri, 7 Jun 2019, H.J. Lu wrote:
> -O3 with AVX vectorizes some loops in sysdeps/ieee754/dbl-64/branred.c
> with 256-bit vector instructions, which leads to store forward stall:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90579
>
> There is no easy fix in compiler. This patch limits vector width to
> 128 bits to work around this issue. It improves performance of sin
> and cos by more than 40% on Skylake compiled with -O3 -march=skylake.
>
> OK for master branch?
>
> * sysdeps/x86_64/fpu/Makefile (CFLAGS-branred.c): New. Set
> to -mprefer-vector-width=128.
This is a case where the Makefile definition clearly needs a comment
explaining the issue, stating what GCC version is known to have the issue
and pointing to the GCC bug.
--
Joseph S. Myers
joseph@codesourcery.com