Re: [PATCH 02/19] MIPS: Add cases for CPU_I6400

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

 



On Thu, Jul 09, 2015 at 11:14:54AM +0100, Markos Chandras wrote:

> On 07/09/2015 11:03 AM, Ralf Baechle wrote:
> > On Thu, Jul 09, 2015 at 10:40:36AM +0100, Markos Chandras wrote:
> > 
> >> index d41e8e284825..abee2bfd10dc 100644
> >> --- a/arch/mips/include/asm/cpu-type.h
> >> +++ b/arch/mips/include/asm/cpu-type.h
> >> @@ -77,6 +77,10 @@ static inline int __pure __get_cpu_type(const int cpu_type)
> >>  	 */
> >>  #endif
> >>  
> >> +#ifdef CONFIG_SYS_HAS_CPU_MIPS64_R6
> >> +	case CPU_I6400:
> >> +#endif
> >> +
> > 
> > To ensure best possible optimization you may want to introduce a new
> > CPU type CPU_I6400 in Kconfig then change above code segment to
> > 
> > #ifdef CONFIG_SYS_HAS_CPU_I6400
> > 	case CPU_I6400:
> > #endif
> > 
> 
> Why? That function uses MIPS32_XX and MIPS64_XX in other places as well.

This is one matters a lot for optimization by GCC.

Currently you're ok for as long as The I6400 stays the sole CPU wrapped
by #ifdef CONFIG_SYS_HAS_CPU_MIPS64_R6.  As soon as another CPU becomes
does the same optimization will suffer.

Example:

#ifdef CONFIG_SYS_HAS_CPU_MIPS32_R1
        case CPU_4KC:
        case CPU_ALCHEMY:
        case CPU_PR4450:
#endif

GCC is clever enough these days to figure out that __get_cpu_type() will
only return certain values so it will do some optimization but the best
case of course is if __get_cpu_type() returns one value only.

  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