From: Scott Wood <scottwood@freescale.com>
To: "\"“tiejun.chen”\"" <tiejun.chen@windriver.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [RFC][PATCH] powerpc/CoreNet64: compile with CONFIG_E{5,6}500_CPU well
Date: Thu, 21 Nov 2013 11:42:59 -0600 [thread overview]
Message-ID: <1385055779.1403.476.camel@snotra.buserror.net> (raw)
In-Reply-To: <528DCB61.8040807@windriver.com>
On Thu, 2013-11-21 at 16:59 +0800, "=E2=80=9Ctiejun.chen=E2=80=9D" wrote:
> On 11/21/2013 12:41 AM, Scott Wood wrote:
> > On Wed, 2013-11-20 at 16:35 +0800, Tiejun Chen wrote:
> >> +# Altivec and Spe options not allowed with e500mc64 in GCC.
> >> +ifeq ($(call cc-option-yn,-mcpu=3De500mc64),n)
> >> obj-$(CONFIG_ALTIVEC) +=3D xor_vmx.o
> >> CFLAGS_xor_vmx.o +=3D -maltivec -mabi=3Daltivec
> >> +endif
> >
> > This does not seem like the right fix. What if GCC supports both
> > -mcpu=3De500mc64 and -mcpu=3De6500, and we're using the latter? Or f=
or that
>=20
> I can understand what you mean, but in current kernel, -mcpu=3De500mc64=
should be=20
> excluded from -mcpu=3De6500,
>=20
> arch/powerpc/Makefile:
>=20
> E5500_CPU :=3D $(call cc-option,-mcpu=3De500mc64,-mcpu=3Dpowerpc64)
> CFLAGS-$(CONFIG_E5500_CPU) +=3D $(E5500_CPU)
> CFLAGS-$(CONFIG_E6500_CPU) +=3D $(call cc-option,-mcpu=3De6500,$(E5500_=
CPU))
But your patch doesn't test what options we're actually using. You
tested what options the compiler supports.
> But unfortunately, another place also use the same option,
>=20
> lib/raid6/Makefile:
>=20
> raid6_pq-$(CONFIG_ALTIVEC) +=3D altivec1.o altivec2.o altivec4.o altive=
c8.o
> ...
> ifeq ($(CONFIG_ALTIVEC),y)
> altivec_flags :=3D -maltivec -mabi=3Daltivec
> endif
>=20
> Looks we have to do something in this common Makefile file as well, but=
it may=20
> be a bit ugly if still judge some cpu-specific flags...
>=20
> So what about this version?
>=20
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index 607acf5..872a85c 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -127,7 +127,12 @@ CFLAGS-$(CONFIG_POWER5_CPU) +=3D $(call cc-option,=
-mcpu=3Dpower5)
> CFLAGS-$(CONFIG_POWER6_CPU) +=3D $(call cc-option,-mcpu=3Dpower6)
> CFLAGS-$(CONFIG_POWER7_CPU) +=3D $(call cc-option,-mcpu=3Dpower7)
>=20
> +# Altivec and Spe options not allowed with e500mc64 in GCC.
> +ifeq ($(CONFIG_ALTIVEC),)
> E5500_CPU :=3D $(call cc-option,-mcpu=3De500mc64,-mcpu=3Dpowerpc64)
> +else
> +E5500_CPU :=3D -mcpu=3Dpowerpc64
> +endif
> CFLAGS-$(CONFIG_E5500_CPU) +=3D $(E5500_CPU)
> CFLAGS-$(CONFIG_E6500_CPU) +=3D $(call cc-option,-mcpu=3De6500,$(E550=
0_CPU))
Reverse the if/else so it uses positive logic, and remove the irrelevant
SPE from the comment, but otherwise I guess it's OK.
-Scott
prev parent reply other threads:[~2013-11-21 17:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 8:35 [RFC][PATCH] powerpc/CoreNet64: compile with CONFIG_E{5, 6}500_CPU well Tiejun Chen
2013-11-20 16:41 ` [RFC][PATCH] powerpc/CoreNet64: compile with CONFIG_E{5,6}500_CPU well Scott Wood
2013-11-20 18:47 ` [RFC][PATCH] powerpc/CoreNet64: compile with CONFIG_E{5, 6}500_CPU well Kumar Gala
2013-11-20 22:03 ` [RFC][PATCH] powerpc/CoreNet64: compile with CONFIG_E{5,6}500_CPU well Scott Wood
2013-11-21 8:59 ` [RFC][PATCH] powerpc/CoreNet64: compile with CONFIG_E{5, 6}500_CPU well "“tiejun.chen”"
2013-11-21 17:42 ` Scott Wood [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385055779.1403.476.camel@snotra.buserror.net \
--to=scottwood@freescale.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=tiejun.chen@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).