From: Florian Fainelli <florian@openwrt.org>
To: "Steven J. Hill" <sjhill@mips.com>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] MIPS: dsp: Add assembler support for DSP ASEs.
Date: Wed, 12 Dec 2012 15:24:12 +0100 [thread overview]
Message-ID: <50C8938C.8020705@openwrt.org> (raw)
In-Reply-To: <1354855981-28392-1-git-send-email-sjhill@mips.com>
Hi Steven,
Le 12/07/12 05:53, Steven J. Hill a écrit :
> From: "Steven J. Hill" <sjhill@mips.com>
>
> Newer toolchains support the DSP and DSP Rev2 instructions. This patch
> performs a check for that support and adds compiler and assembler
> flags for only the files that need use those instructions.
>
> Signed-off-by: Steven J. Hill <sjhill@mips.com>
> ---
> arch/mips/include/asm/mipsregs.h | 53 ++++++++++++++++++++++++++------------
> arch/mips/kernel/Makefile | 24 +++++++++++++++++
> 2 files changed, 60 insertions(+), 17 deletions(-)
>
> --- a/arch/mips/kernel/Makefile
> +++ b/arch/mips/kernel/Makefile
> @@ -99,4 +99,28 @@ obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_mipsxx.o
>
> obj-$(CONFIG_JUMP_LABEL) += jump_label.o
>
> +ifeq ($(CONFIG_CPU_MIPS32), y)
> +#
> +# Check if assembler supports DSP ASE
> +#
> +ifeq ($(call cc-option-yn,-mdsp), y)
> +CFLAGS_signal.o = -mdsp -DHAVE_AS_DSP
> +CFLAGS_signal32.o = -mdsp -DHAVE_AS_DSP
> +CFLAGS_process.o = -mdsp -DHAVE_AS_DSP
> +CFLAGS_branch.o = -mdsp -DHAVE_AS_DSP
> +CFLAGS_ptrace.o = -mdsp -DHAVE_AS_DSP
> +endif
> +
> +#
> +# Check if assembler supports DSP ASE Rev2
> +#
> +ifeq ($(call cc-option-yn,-mdsp2), y)
> +CFLAGS_signal.o = -mdsp2 -DHAVE_AS_DSP
> +CFLAGS_signal32.o = -mdsp2 -DHAVE_AS_DSP
> +CFLAGS_process.o = -mdsp2 -DHAVE_AS_DSP
> +CFLAGS_branch.o = -mdsp2 -DHAVE_AS_DSP
> +CFLAGS_ptrace.o = -mdsp2 -DHAVE_AS_DSP
Should not this be -mdspr2 here? My GCC man page suggests that.
By the way, should not we also check that we are building for a
MIPS32_R2 CPU when checking for -mdsp2?
> +endif
> +endif
> +
I would simplify this like this:
ifeq ($(CONFIG_CPU_MIPS32),y)
CFLAGS_DSP = -DHAVE_AS_DSP
ifeq ($(call cc-option-yn,-mdsp),y)
CFLAGS_DSP += -mdsp
endif
ifeq ($(call cc-option-yn,-mdsp2),y)
CFLAGS-DSP += -mdsp2
endif
CFLAGS_signal.o = $(CFLAGS_DSP)
...
CFLAGS_ptrace.o = $(CFLAGS_DSP)
endif
such that the day you can take advantage of a third DSP flavor it's only
3 lines worth of Makefile to get it used, and you only have one place
where you need to change CFLAGS.
--
Florian
next prev parent reply other threads:[~2012-12-12 14:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-07 4:53 [PATCH] MIPS: dsp: Add assembler support for DSP ASEs Steven J. Hill
2012-12-12 14:24 ` Florian Fainelli [this message]
2012-12-15 5:10 ` Hill, Steven
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=50C8938C.8020705@openwrt.org \
--to=florian@openwrt.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=sjhill@mips.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