[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#408918: [powerpc] -maltivec generates AltiVec code when not asked to



* Sam Hocevar <sam@zoy.org> [2007-01-29 02:52]:
>    The way I understand the -maltivec flag is "make the compiler aware
> of AltiVec instructions and the vector type, but only generate AltiVec
> code if the <altivec.h> intrinsics are being used", whereas -mabi=altivec
> means "generate AltiVec code wherever possible".
> 
>    However, the following code, which doesn't even include <altivec.h>,
> generates AltiVec code with gcc-4.0 and gcc-4.1:

I asked a GCC developer about this:

01:06 <tbm> any comment on
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=408918
01:06 <apinski> yes it is not a bug
01:08 <tbm> why?
01:08 <apinski> because -maltivec enables altivec usage in general
01:09 <apinski> "Generate code that uses (does not use) AltiVec
  instructions, and also enable the use of built-in functions that
  allow more direct access to the AltiVec instruction set.  You may
  also need to set -mabi=altivec to adjust the current ABI with AltiVec
  ABI enhancements." [that's from the docs]
01:11 <apinski> and it has been this way since at least 4.0.4
01:14 <apinski> also the reason why memset generates altivec is
  because it is faster than using scalars anyways

-- 
Martin Michlmayr
http://www.cyrius.com/



Reply to: