Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Kevin D. Kissell" <kevink@mips.com>
To: "Franck" <vagabon.xyz@gmail.com>, "Nigel Stephens" <nigel@mips.com>
Cc: <linux-mips@linux-mips.org>
Subject: Re: [RFC] Optimize swab operations on mips_r2 cpu
Date: Fri, 27 Jan 2006 16:39:59 +0100	[thread overview]
Message-ID: <00df01c62357$ef9a1fa0$10eca8c0@grendel> (raw)
In-Reply-To: cda58cb80601270654jf779622w@mail.gmail.com


> > Not that I'm a Linux hacker, but aren't those separate things? Can't you
> > compile with -march=4ksd to get the CPU-specific compiler optimisations,
> > but then use the more generic CONFIG_CPU_MIPSR2 and/or
> > CONFIG_CPU_SMARTMIPS to select the appropriate code inside the kernel
> > source (i.e. no need for CONFIG_CPU_4KSD)?
> >
> 
> To use -march=4ksd, you need to tell to the building process that
> you're using a 4KSD cpu. The only way to do that is to define a new
> CPU_4KSD. But, if I understood mips configuration script, you cannot
> define CPU_4KSD _and_ CPU_MIPS32R2 at the same time; at least easily.

The point is not to set CPU_4KSD and CPU_MIPS32R2 at the same time,
the point is to not have to define CPU_4KSD *at all*, and use the combination
of MIPS32R2 and SMARTMIPS to drive the options, e.g.:

ifdef CONFIG_CPU_SMARTMIPS
cflags-$(CONFIG_CPU_MIPS32R1)   += \
                        $(call set_gccflags,mips32,smartmips,4kec,mips3,mips2)\
                        -Os, -Wa,--trap

cflags-$(CONFIG_CPU_MIPS32R2)   += \
                        $(call set_gccflags,4ksd,mips32r2,4kec,mips3,mips2) \
                        -Wa,--trap
else
cflags-$(CONFIG_CPU_MIPS32R1)   += \
                        $(call set_gccflags,mips32,mips32,r4600,mips3,mips2) \
                        -Wa,--trap

cflags-$(CONFIG_CPU_MIPS32R2)   += \
                        $(call set_gccflags,mips32r2,mips32r2,r4600,mips3,mips2)
 \
                        -Wa,--trap
endif


That's almost certainly not the cleanest way to do it (and I really don't know
if the values I threw in for the MIPS32R1+SmartMIPS (e.g. 4KSc) combination
would actually work.  I just want to point out that it isn't that hard to do.

            Regards,

            Kevin K.

WARNING: multiple messages have this Message-ID (diff)
From: "Kevin D. Kissell" <kevink@mips.com>
To: Franck <vagabon.xyz@gmail.com>, Nigel Stephens <nigel@mips.com>
Cc: linux-mips@linux-mips.org
Subject: Re: [RFC] Optimize swab operations on mips_r2 cpu
Date: Fri, 27 Jan 2006 16:39:59 +0100	[thread overview]
Message-ID: <00df01c62357$ef9a1fa0$10eca8c0@grendel> (raw)
Message-ID: <20060127153959.KCLeD_lnFdRP9mc6BQEb6zPcESiepRA3KiczMj3BdcU@z> (raw)
In-Reply-To: cda58cb80601270654jf779622w@mail.gmail.com


> > Not that I'm a Linux hacker, but aren't those separate things? Can't you
> > compile with -march=4ksd to get the CPU-specific compiler optimisations,
> > but then use the more generic CONFIG_CPU_MIPSR2 and/or
> > CONFIG_CPU_SMARTMIPS to select the appropriate code inside the kernel
> > source (i.e. no need for CONFIG_CPU_4KSD)?
> >
> 
> To use -march=4ksd, you need to tell to the building process that
> you're using a 4KSD cpu. The only way to do that is to define a new
> CPU_4KSD. But, if I understood mips configuration script, you cannot
> define CPU_4KSD _and_ CPU_MIPS32R2 at the same time; at least easily.

The point is not to set CPU_4KSD and CPU_MIPS32R2 at the same time,
the point is to not have to define CPU_4KSD *at all*, and use the combination
of MIPS32R2 and SMARTMIPS to drive the options, e.g.:

ifdef CONFIG_CPU_SMARTMIPS
cflags-$(CONFIG_CPU_MIPS32R1)   += \
                        $(call set_gccflags,mips32,smartmips,4kec,mips3,mips2)\
                        -Os, -Wa,--trap

cflags-$(CONFIG_CPU_MIPS32R2)   += \
                        $(call set_gccflags,4ksd,mips32r2,4kec,mips3,mips2) \
                        -Wa,--trap
else
cflags-$(CONFIG_CPU_MIPS32R1)   += \
                        $(call set_gccflags,mips32,mips32,r4600,mips3,mips2) \
                        -Wa,--trap

cflags-$(CONFIG_CPU_MIPS32R2)   += \
                        $(call set_gccflags,mips32r2,mips32r2,r4600,mips3,mips2)
 \
                        -Wa,--trap
endif


That's almost certainly not the cleanest way to do it (and I really don't know
if the values I threw in for the MIPS32R1+SmartMIPS (e.g. 4KSc) combination
would actually work.  I just want to point out that it isn't that hard to do.

            Regards,

            Kevin K.

  parent reply	other threads:[~2006-01-27 15:33 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-25  9:36 [RFC] Optimize swab operations on mips_r2 cpu Franck
2006-01-25 12:47 ` Ralf Baechle
2006-01-25 13:34   ` Franck
2006-01-25 14:11     ` Kevin D. Kissell
2006-01-25 14:14       ` Ralf Baechle
2006-01-25 14:32         ` Franck
2006-01-25 15:04           ` Ralf Baechle
2006-01-25 18:03             ` Franck
2006-01-25 18:15               ` Kevin D. Kissell
2006-01-26  8:11                 ` Franck
2006-01-26  8:26                   ` Kevin D. Kissell
2006-01-26  8:47                     ` Franck
2006-01-26  9:17                       ` Kevin D. Kissell
2006-01-26  9:17                         ` Kevin D. Kissell
2006-01-26 11:56                         ` Franck
2006-01-26 15:02                 ` Franck
2006-01-26 15:23                   ` Kevin D. Kissell
2006-01-26 15:23                     ` Kevin D. Kissell
2006-01-26 15:29                     ` Franck
2006-01-26 15:51                     ` Nigel Stephens
2006-01-26 16:31                       ` Franck
2006-01-26 16:53                         ` Kevin D. Kissell
2006-01-26 16:53                           ` Kevin D. Kissell
2006-01-26 16:55                         ` Nigel Stephens
2006-01-26 18:02                           ` Franck
2006-01-26 20:25                             ` Nigel Stephens
2006-01-27  9:03                               ` Franck
2006-01-27 10:13                                 ` Kevin D. Kissell
2006-01-27 10:13                                   ` Kevin D. Kissell
2006-01-27 10:45                                   ` Franck
2006-01-27 11:31                                     ` Ralf Baechle
2006-01-27 12:53                                     ` Kevin D. Kissell
2006-01-27 12:53                                       ` Kevin D. Kissell
2006-01-27 14:44                                       ` Franck
2006-01-27 11:30                                   ` Ralf Baechle
2006-01-27 13:45                                 ` Nigel Stephens
2006-01-27 14:54                                   ` Franck
2006-01-27 15:04                                     ` Maciej W. Rozycki
2006-01-27 15:39                                     ` Kevin D. Kissell [this message]
2006-01-27 15:39                                       ` Kevin D. Kissell
2006-01-27 17:32                                       ` Franck
2006-01-29 15:07                                         ` Ralf Baechle
2006-01-30 13:08                                           ` Maciej W. Rozycki
2006-01-30 14:31                                           ` Franck

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='00df01c62357$ef9a1fa0$10eca8c0@grendel' \
    --to=kevink@mips.com \
    --cc=linux-mips@linux-mips.org \
    --cc=nigel@mips.com \
    --cc=vagabon.xyz@gmail.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