Re: [PATCH] MIPS: dsp: Add assembler support for DSP ASEs.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Steven,

Le 12/07/12 05:53, Steven J. Hill a écrit :
From: "Steven J. Hill" <sjhill@xxxxxxxx>

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@xxxxxxxx>
---
  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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux