This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386]: Add arch flag for sahf instruction
- From: Jan Hubicka <jh at suse dot cz>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <jh at suse dot cz>
- Date: Thu, 8 Mar 2007 12:40:46 +0100
- Subject: Re: [PATCH, i386]: Add arch flag for sahf instruction
- References: <5787cf470703080326r2ddebbc2y55bc1a84b1671cc3@mail.gmail.com>
> On 3/7/07, Richard Henderson <rth@redhat.com> wrote:
>
> >This is not something appropriate for tune, because it
> >does *not* work for a subset of the 64-bit chips. It
> >would have to be an arch switch instead.
>
> Attached patch adds arch flag for sahf instruction. in x86_64, I
> propose following:
>
> gcc -march=(any 64bit arch) generates sahf instruction depending on tune
> flags.
> gcc -mtune=(any 64bit arch) does not generate sahf instruction.
>
> This solves the problem of supporting very old x86_64 prototypes. gcc
> does not generate sahf by default, but -march= switch implies that
> user has recent enough processor. However, there is no problem to
> switch sahf off on a per-processor basis by adding TARGET_NO_SAHF to
> affected processor flags.
>
> Also, this patch cleans handling of TARGET_USE_SAHF flag through the
> sources.
The patch is fine with me, just I think H. J. should comment on whether
-march=nocona should use sahf or not. I believe it is not only about
very old prototypes, but also about early production machines.
(at least my Nocna box does reject SAHF)
Honza