This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Add --alt-nops=short|long to x86/x86-64 assemblers


On Thu, Jun 15, 2006 at 06:41:23PM +0100, Paul Brook wrote:
> > > > I was talking about the code like
> > > >
> > > > 	asm ("some SSE instruction");
> > > >
> > > > If gcc starts to generate ".arch i686", the code above won't compile
> > > > any more.
> > >
> > > I'd say that code is broken. You'd have the same problem if you
> > > implemented the commandline options. I don't really see why x86 is any
> > > different to other architectures in this respect.
> >
> > x86 is different, for better or worse. The reality is we can't change
> > it in such a way that all sudden the existing codes won't compile any
> > more.
> 
> Well, doesn't the same argument apply to commandline arguments. 
> Having -march=i686 behave differently to ".arch i686" sounds like a really 
> bad idea to me.

That is why I am planning to add -mtune=, not -march=. There are

  if (value == CODE_64BIT && !(cpu_arch_flags & CpuSledgehammer))
    {
      as_bad (_("64bit mode not supported on this CPU."));
    }

in assembler. The reasons we haven't run into any serious problems are

1. By default, cpu_arch_flags is set to accept everything.
2. .arch directive isn't used much.

So my -mtune=CPU switch will optimize for CPU by generating instruction
for CPU if instruction set of CPU is available.


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]