gcc 4.0 compiles kernel with altivec

Alan Modra amodra at bigpond.net.au
Wed Feb 16 22:00:22 EST 2005

On Wed, Feb 16, 2005 at 08:01:35PM +1100, Anton Blanchard wrote:
> A recent gcc 4.0 snapshot is using altivec instructions in the kernel:
> c0000000000d6434 <.wait_for_completion>:
> c0000000000d6434:       7c 00 42 a6     mfvrsave r0

gcc-4.0 will use altivec for moving blocks of memory around.

> Its probably because we are passing the -mcpu=970 option:
> ifeq ($(CONFIG_POWER4_ONLY),y)
> ifeq ($(CONFIG_ALTIVEC),y)
>         CFLAGS += $(call cc-option,-mcpu=970)
> else

Yes, -mcpu=970 says altivec is available (and thus use it).  In fact,
the only difference between -mcpu=power4 and -mcpu=970 is enabling

Alan Modra
IBM OzLabs - Linux Technology Centre

More information about the Linuxppc64-dev mailing list