[PATCH] Don't set x86_prefetch_sse based on -mtune= option
Jakub Jelinek
jakub@redhat.com
Wed Jul 7 21:26:00 GMT 2004
On Wed, Jul 07, 2004 at 10:16:49PM +0200, Jan Hubicka wrote:
> > Hi!
> >
> > gcc -O2 -march=i386 -mtune=pentium4,
> > which ought to mean generate code which will run on any i386 compatible CPU,
> > but tune for P4, might use SSE prefetch instructions, which IMHO is a big
> > no no. Only -march= should influence selection of instructions which aren't
> > available on all CPUs, -mtune= should only be about scheduling and/or
> > selection among instructions which are available on the -march= CPU.
> > Certainly e.g. VIA C3 SIGILLs on the prefetch instructions present
> > in -O2 -march=i386 -mtune=pentium4 compiled gcc.
>
> This is interesting as Intel has even patent pending on the idea of
> replacing instructions interpreted as NOPs by earlier CPUs by something
> ignoreable in future revisions. SSE prefetches should be precisely one
> of these. It looks like VIA has screwed up :(
If it is just VIA C3 which SIGILLs on them, we could perhaps set
x86_prefetch_sse = true if tune CPU has PTA_PREFETCH_SSE and
TARGET_CMOVE.
So -march=i386 -mtune=pentium4 would not generate prefetches but
-march=i686 -mtune=pentium4 would. The latter can't run on pre-cmov/sse
VIAs.
Jakub
More information about the Gcc-patches
mailing list