> Oh, and there are gcc version that will refuse -mcpu=power4 -maltivec so
> I can't even use -mcpu=power4 for the whole kernel and -maltivec just
> for the file containing the raid6 code.
        As Andrew Pinski mentioned, you also can use -mcpu=970
-mno-altivec.  That should allow the assembler to accept Altivec
instructions, but GCC will not know about any Altivec registers for
inlined assembly parameters.

> So what is the proper way or set of options for me to:

> 1) optionally have POWER4 optimisations (that must be independant on
> the rest below)
> 2) be able to use altivec instructions in assembly
> 3) be able to use altivec in a few selected bits of C code
> 4) never have altivec code implicitely generated by the compiler

        It sounds like you are making conflicting requests of the
compiler.  You want the compiler to know about VMX registers, have them
active, use them in inlined assembly, but not have the compiler generate
VMX instructions itself.  If you use the compiler in inconsistent ways,
you are going to run into trouble.

        As GCC improves, you cannot safely do what you want.  VMX needs to
be treated like floating point.  The kernel is compiled with soft-float
and explicitly enables and disables the FPU in assembly code when it wants
to access it.  The compiler does not know about the FPU.  VMX should be
accessed the same way, completely disabled in the compiler and only used
in self-contained assembly.

        You cannot tell the compiler to enable VMX but "do what I mean"
and not use it.  That is inconsistent.

David

Reply via email to