All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Joshua Kinard <kumba@gentoo.org>
Cc: Matt Turner <mattst88@gmail.com>,
	Linux MIPS List <linux-mips@linux-mips.org>
Subject: Re: [PATCH] MIPS: Add R16000 detection
Date: Tue, 20 Jan 2015 14:51:15 +0100	[thread overview]
Message-ID: <20150120135114.GG1205@linux-mips.org> (raw)
In-Reply-To: <54BDE881.3090907@gentoo.org>

On Tue, Jan 20, 2015 at 12:32:49AM -0500, Joshua Kinard wrote:

> I see what you're getting at, but I disagree with the reasoning.  The code
> reads clearer when it's explicitly stated the way it is, rather than fudging
> things and treating an R14K as an R12K for a minor gain of a few cycles.
> 
> And since I know there's something "weird" about the R14K right now, one of
> those case statements might be needed down the road to do something a little
> bit differently for R14K versus R12K and such (maybe in the TLB code, if I can
> ever wrap my head around that).
> 
> In the end, it's Ralf's call on accepting it.

The way the code of current_cpu_type() is written, gcc can know that it
may only return certain values.  Which for example means that a system has
an R1x0000 but not a MIPS32 processor.  It then case use that knowledge to
eleminate all dead case and if () statements.

The scheme is not fine grained enough to differenciate between R10000, R12000,
R14000.  That's possible but that's where madness lies.  See __get_cpu_type()
in include/asm/cpu-type.h for details.

We have a number of processors types that need no or very little special
support code yet have special code to distinguish them.  R2000/R3000, R4000/
R4400 are examples.  Sometimes we distinguish them just to make sure the
expected name is displayed in /proc/cpuinfo.

  Ralf

  reply	other threads:[~2015-01-20 13:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19  1:30 [PATCH] MIPS: Add R16000 detection Joshua Kinard
2015-01-19 19:34 ` Matt Turner
2015-01-20  0:56   ` Joshua Kinard
2015-01-20  2:43     ` Matt Turner
2015-01-20  4:13       ` Joshua Kinard
2015-01-20  5:11         ` Matt Turner
2015-01-20  5:32           ` Joshua Kinard
2015-01-20 13:51             ` Ralf Baechle [this message]
2015-01-21 12:56 ` Joshua Kinard

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=20150120135114.GG1205@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=kumba@gentoo.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mattst88@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.