Re: [PATCH RFC v2 19/70] MIPS: Use the new "ZC" constraint for MIPS R6

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

 



On 01/20/2015 02:37 PM, Maciej W. Rozycki wrote:
> On Tue, 20 Jan 2015, Markos Chandras wrote:
> 
>>>> We have tools out there based on 4.9. If we make gcc < 5.0 to fail with
>>>> R6, then nobody will be able to build it until 5.0 is released.
>>>> Perhaps it makes sense to add some checks in arch/mips/Makefile, see if
>>>> our gcc supports -mips32r6 or something and then decide what to do.
>>>
>>> Indeed, I think it is worthwhile supporting the use of tools which have R6
>>> backported to them owing to long lead times for new versions of GCC to be
>>> released.
>>>
>>> I think you could actually just switch the check around and remove the
>>> check for micromips entirely, putting the GCC 4.9 check first:
>>>
>>> #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)
>>> #define GCC_OFF12_ASM() "ZC"
>>> #else
>>> #define GCC_OFF12_ASM() "R"
>>> #endif
>>>
>>> From what I can see this is safe. It was presumably written with a micromips
>>> check out of caution to not change older non-micromips code-gen but that
>>> doesn't seem particularly important. It is an improvement to older code if
>>> anything.
>>
>> For non-micromips kernel, this will start using "ZC" instead of "R",
>> whereas before, it only used "ZC" for micromips and "R" for everything
>> else. Is that safe? Maciej was the one committed this code, so if that's
>> still safe, then I will change it as requested.
> 
>  I'm fine with this proposal; a separate Makefile check for 
> `-march=mips32r6' support would be good too.
> 
>   Maciej
> 
I think we are over engineering this. In patch 04/70 you suggested

cflags-$(CONFIG_CPU_MIPS32_R6)	+= -march=mips32r6 -Wa,--trap
cflags-$(CONFIG_CPU_MIPS64_R6)	+= -march=mips64r6 -Wa,--trap

that means that you will pass march=mips32r6 if _R6 is selected without
checking if the toolchain support.

We know that every toolchain that has r6 support will have ZC support as
well. So my question is, why is the original patch wrong. Do you really
need to trap here for r6? Like I said, ever R6 toolchain will support
ZC. If you are trying to build R6 with a non-r6 toolchain you surely
have broken the build earlier on.

Having said that. I believe the original patch is fine.

-- 
markos





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

  Powered by Linux