Re: [PATCH] MIPS: Add R16000 detection

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

 



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




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

  Powered by Linux