linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Set cpu type explicitly, take 2
@ 2005-05-20  6:05 Paul Mackerras
  2005-05-20  7:45 ` Benjamin Herrenschmidt
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Paul Mackerras @ 2005-05-20  6:05 UTC (permalink / raw)
  To: linuxppc-dev

Here is a revised version of my patch to set the cpu type explicitly
for gcc when compiling the kernel.  Setting the cpu type is a good
idea in any case, and particularly if you have a biarch gcc.  This
sets the type for all of the ppc cpu families we support.

Any further comments?  Are -mcpu=860 and -mcpu=8540 reasonable for 8xx
and 85xx respectively?  I used -mcpu=power4 rather than -mcpu=970
because the former works with gcc-3.6.6 as in debian and the latter
doesn't.  Unfortunately -mcpu=440 doesn't work either in gcc 3.3,
though it does in gcc 3.4 (as does -mcpu=970).

Paul.

diff -urN linux-2.6/arch/ppc/Makefile pmac-2.5/arch/ppc/Makefile
--- linux-2.6/arch/ppc/Makefile	2005-05-02 08:29:36.000000000 +1000
+++ pmac-2.5/arch/ppc/Makefile	2005-05-19 15:26:42.000000000 +1000
@@ -23,15 +23,20 @@
 LDFLAGS_vmlinux	:= -Ttext $(KERNELLOAD) -Bstatic
 CPPFLAGS	+= -Iarch/$(ARCH)
 AFLAGS		+= -Iarch/$(ARCH)
-CFLAGS		+= -Iarch/$(ARCH) -msoft-float -pipe \
-		-ffixed-r2 -mmultiple
+CFLAGS		+= -Iarch/$(ARCH) -msoft-float -pipe -ffixed-r2 -mmultiple
 CPP		= $(CC) -E $(CFLAGS)
 
 CHECKFLAGS	+= -D__powerpc__
 
-ifndef CONFIG_E500
-CFLAGS		+= -mstring
-endif
+cpu-opt-$(CONFIG_6xx)		+= -mcpu=750 -mtune=7450
+cpu-opt-$(CONFIG_40x)		+= -mcpu=405
+cpu-opt-$(CONFIG_44x)		+= -mcpu=440
+cpu-opt-$(CONFIG_POWER3)	+= -mcpu=power3
+cpu-opt-$(CONFIG_POWER4)	+= -mcpu=power4
+cpu-opt-$(CONFIG_8xx)		+= -mcpu=860
+cpu-opt-$(CONFIG_E500)		+= -mcpu=8540
+
+CFLAGS += $(cpu-opt-y)
 
 cpu-as-$(CONFIG_PPC64BRIDGE)	+= -Wa,-mppc64bridge
 cpu-as-$(CONFIG_4xx)		+= -Wa,-m405

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Set cpu type explicitly, take 2
  2005-05-20  6:05 [PATCH] Set cpu type explicitly, take 2 Paul Mackerras
@ 2005-05-20  7:45 ` Benjamin Herrenschmidt
  2005-05-20 14:30   ` Dan Malek
  2005-05-20 14:28 ` Dan Malek
  2005-05-20 14:59 ` Kumar Gala
  2 siblings, 1 reply; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2005-05-20  7:45 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

On Fri, 2005-05-20 at 16:05 +1000, Paul Mackerras wrote:
> Here is a revised version of my patch to set the cpu type explicitly
> for gcc when compiling the kernel.  Setting the cpu type is a good
> idea in any case, and particularly if you have a biarch gcc.  This
> sets the type for all of the ppc cpu families we support.
> 
> Any further comments?  Are -mcpu=860 and -mcpu=8540 reasonable for 8xx
> and 85xx respectively?  I used -mcpu=power4 rather than -mcpu=970
> because the former works with gcc-3.6.6 as in debian and the latter
> doesn't.  Unfortunately -mcpu=440 doesn't work either in gcc 3.3,
> though it does in gcc 3.4 (as does -mcpu=970).

The problem is the same as ppc64 isn't it ?, -maltivec doesn't work with
-mcpu=power4 on gcc 3.4 does it ? That would mean no RAID6...

Ben.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Set cpu type explicitly, take 2
  2005-05-20  6:05 [PATCH] Set cpu type explicitly, take 2 Paul Mackerras
  2005-05-20  7:45 ` Benjamin Herrenschmidt
@ 2005-05-20 14:28 ` Dan Malek
  2005-05-21  0:55   ` Paul Mackerras
  2005-05-20 14:59 ` Kumar Gala
  2 siblings, 1 reply; 7+ messages in thread
From: Dan Malek @ 2005-05-20 14:28 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev


On May 20, 2005, at 2:05 AM, Paul Mackerras wrote:

> Any further comments?  Are -mcpu=860 and -mcpu=8540 reasonable for 8xx
> and 85xx respectively?

Yes.

Is there now some minimum gcc version that is required for
using these flags?

Thanks.

	-- Dan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Set cpu type explicitly, take 2
  2005-05-20  7:45 ` Benjamin Herrenschmidt
@ 2005-05-20 14:30   ` Dan Malek
  2005-05-20 22:27     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Malek @ 2005-05-20 14:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev


On May 20, 2005, at 3:45 AM, Benjamin Herrenschmidt wrote:

> The problem is the same as ppc64 isn't it ?, -maltivec doesn't work 
> with
> -mcpu=power4 on gcc 3.4 does it ? That would mean no RAID6...

I don't understand "doesn't work."  Does power4 imply altivec?
Do we need to add -maltivec based on the configuration option?

Thanks.

	-- Dan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Set cpu type explicitly, take 2
  2005-05-20  6:05 [PATCH] Set cpu type explicitly, take 2 Paul Mackerras
  2005-05-20  7:45 ` Benjamin Herrenschmidt
  2005-05-20 14:28 ` Dan Malek
@ 2005-05-20 14:59 ` Kumar Gala
  2 siblings, 0 replies; 7+ messages in thread
From: Kumar Gala @ 2005-05-20 14:59 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev


On May 20, 2005, at 1:05 AM, Paul Mackerras wrote:

> Here is a revised version of my patch to set the cpu type explicitly
> for gcc when compiling the kernel.  Setting the cpu type is a good
> idea in any case, and particularly if you have a biarch gcc.  This
> sets the type for all of the ppc cpu families we support.
>
> Any further comments?  Are -mcpu=860 and -mcpu=8540 reasonable for 8xx
> and 85xx respectively?  I used -mcpu=power4 rather than -mcpu=970
> because the former works with gcc-3.6.6 as in debian and the latter
> doesn't.  Unfortunately -mcpu=440 doesn't work either in gcc 3.3,
> though it does in gcc 3.4 (as does -mcpu=970).

Yes, -mcpu=8540 is reasonable for 85xx.

- kumar

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Set cpu type explicitly, take 2
  2005-05-20 14:30   ` Dan Malek
@ 2005-05-20 22:27     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2005-05-20 22:27 UTC (permalink / raw)
  To: Dan Malek; +Cc: linuxppc-dev

On Fri, 2005-05-20 at 10:30 -0400, Dan Malek wrote:
> On May 20, 2005, at 3:45 AM, Benjamin Herrenschmidt wrote:
> 
> > The problem is the same as ppc64 isn't it ?, -maltivec doesn't work 
> > with
> > -mcpu=power4 on gcc 3.4 does it ? That would mean no RAID6...
> 
> I don't understand "doesn't work."  Does power4 imply altivec?
> Do we need to add -maltivec based on the configuration option?

No, -mcpu=970 is equivalent in a way to -mcpu=power4 and -maltivec,
howevever, there is a bug in gcc 3.4 which makes -maltivec cause an
error if you have -mcpu=power4. The RAID6 code needs -maltivec. So on
gcc 3.4, we need to use -mcpu=970 instead of -mcpu=power4. However, we
must _NOT_ do that on gcc-4.0 as that causes it to implicitely generate
altivec code all over the place. (Fortunately, the bug is also fixed
there, so with gcc-4.0, we just need -mcpu=power4 and -maltivec only on
the RAID6 code)

Messy ? Yeah !

Ben.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Set cpu type explicitly, take 2
  2005-05-20 14:28 ` Dan Malek
@ 2005-05-21  0:55   ` Paul Mackerras
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Mackerras @ 2005-05-21  0:55 UTC (permalink / raw)
  To: Dan Malek; +Cc: linuxppc-dev

Dan Malek writes:

> Is there now some minimum gcc version that is required for
> using these flags?

Interestingly, gcc-2.95 seems to accept -mcpu=xxx for any xxx.
gcc-3.2 will accept -mcpu=860 but not -mcpu=8540, and gcc-3.3 and
later will accept both.

Paul.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-05-21  0:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-20  6:05 [PATCH] Set cpu type explicitly, take 2 Paul Mackerras
2005-05-20  7:45 ` Benjamin Herrenschmidt
2005-05-20 14:30   ` Dan Malek
2005-05-20 22:27     ` Benjamin Herrenschmidt
2005-05-20 14:28 ` Dan Malek
2005-05-21  0:55   ` Paul Mackerras
2005-05-20 14:59 ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).