[Top] [All Lists]

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

To: "Steven J. Hill" <>
Subject: Re: [PATCH] MIPS: dsp: Add assembler support for DSP ASEs.
From: Florian Fainelli <>
Date: Wed, 12 Dec 2012 15:24:12 +0100
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=sender:message-id:date:from:organization:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=BWC70ruUfUEo9agIGAATFfwpkH7zOrtLKKd5qdd5hMI=; b=myXHd0WwSTrK//ANhC+hGCWevPPkkzZAV9Cor8Sa8G/3BnZfuwsJUBaU860/XhAI2M 7ceBIb+yFOJd0Bjk2CUjufeYe68JmSIDlHZTkZ/Vz7g+YdPJF+9anbqRPFAjmaJLCA2V nCT3vWlEZJ3WLc9AybX35LJfSSTEq0QKj5+diS6dx7xsikB3w3k10Gnws74WY98U7A0w El0o7wVciMVxLQo3w2IPX2Il+QjyFoc5lb9be3ChMIME+a8LJ92NVnwYlHMXwTvaLxRp ePQbb34dKi9HciElzvWc2GsNDGv3KbtJZd3MwZxq/nPgiOqcsn2YT25XVrSQLqT7xdFc lz2Q==
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Organization: OpenWrt
References: <>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0
Hi Steven,

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

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 <>
  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
+# 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?


I would simplify this like this:

ifeq ($(CONFIG_CPU_MIPS32),y)
ifeq ($(call cc-option-yn,-mdsp),y)
CFLAGS_DSP += -mdsp
ifeq ($(call cc-option-yn,-mdsp2),y)
CFLAGS-DSP += -mdsp2

CFLAGS_signal.o         = $(CFLAGS_DSP)
CFLAGS_ptrace.o         = $(CFLAGS_DSP)

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.

<Prev in Thread] Current Thread [Next in Thread>