altivec problem on x86

Hans-Peter Jansen hpj at urpla.net
Wed Nov 14 13:38:17 CET 2001


On Wednesday, 14. November 2001 00:27, Christophe Massiot wrote:
> À (At) 23:17 +0100 13/11/01, Joakim Elofsson écrivait (wrote) :
> >./configure thinks I got Altivec in my AMD Duron (don't think so:),
> >or gcc at least thinks so.
> >but I think I found the problem, my CFLAGS/CXXFLAGS is usually set
> >to '-march=i686 -O6'
> >and after some tests I found out that if using -Ox with x greater
> >than 2 gcc accepts this:
> >  int main() {
> >void quux(){asm volatile("vperm 0,1,2,3");}
> >; return 0; }
> >now I wonder, is this a gcc-bug? or is vperm some kind of hidden asm
> >stuff (guess not)
>
> gcc just discards the function as it is used nowhere. It can discard
> it because you passed -Ox. We have found a fix, it is in the latest
> CVS. In the meanwhile, the workaround is to unset your CFLAGS (anyway
> I don't think you would see a difference between -O3 and -O6, except
> increased compilation time).

Also note, that -O6 generates slower/malicious code on certain 
conditions/architectures. Therefore it's not wise to put -O6 in CFLAGS
as default.

Cheers,
Hans-Peter




More information about the vlc mailing list