This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve SSE4.1+ float extraction from V4SFmode
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org, "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Mon, 19 Sep 2011 17:42:49 +0200
- Subject: Re: [PATCH] Improve SSE4.1+ float extraction from V4SFmode
- References: <20110919113343.GI2687@tyan-ft48-01.lab.bos.redhat.com>
On Mon, Sep 19, 2011 at 1:33 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> As mentioned in an earlier posting, for -msse4.1 and above
> on the gcc.target/i386/{sse2,avx}-extract-1.c testcases we
> generate inefficient code when trying to extract SFmode
> from V4SFmode, unless it is the element 0.
> The problem is that the sse4_1_extractps pattern matches, but
> doesn't have a "=x" alternative, so we end up doing a
> {,v}extractps into memory and load the SFmode value from memory.
> The following patch adds the alternatives and splitters, so that
> it is reshuffled in that case instead of spilling it.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2011-09-19 ?Jakub Jelinek ?<jakub@redhat.com>
>
> ? ? ? ?* config/i386/sse.md (*sse4_1_extractps): Change into
> ? ? ? ?define_insn_and_split, add =x 0 n and =x x n alternatives
> ? ? ? ?and split them after reload.
> + ?[(set_attr "type" "sselog,*,*")
> + ? (set_attr "isa" "base,noavx,avx")
Please put "isa" attribute as the first in the attribute table. Also,
"base" is the default, so "*,noavx,avx" should do, too.
Thanks,
Uros.