[OpenWrt-Devel] Fwd: [PATCH 2/5] target.mk: add optimization flags for MIPS 24Kc.

Yousong Zhou yszhou4tech at gmail.com
Wed Oct 28 22:34:47 EDT 2015


Fwd to openwrt-devel list.

---------- Forwarded message ----------
From: Yousong Zhou <yszhou4tech at gmail.com>
Date: 29 October 2015 at 09:59
Subject: Re: [OpenWrt-Devel] [PATCH 2/5] target.mk: add optimization
flags for MIPS 24Kc.
To: Cristian Morales Vega <cristian at samknows.com>


On 28 October 2015 at 22:18, Cristian Morales Vega
<cristian at samknows.com> wrote:
> On 28 October 2015 at 12:55, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>> --- a/include/target.mk
>> +++ b/include/target.mk
>> @@ -212,6 +212,7 @@ ifeq ($(DUMP),1)
>>      CPU_CFLAGS_mips32 = -mips32 -mtune=mips32
>>      CPU_CFLAGS_mips32r2 = -mips32r2 -mtune=mips32r2
>>      CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64
>> +    CPU_CFLAGS_24kc = -mips32r2 -mtune=24kc
>>      CPU_CFLAGS_24kec = -mips32r2 -mtune=24kec
>>      CPU_CFLAGS_34kc = -mips32r2 -mtune=34kc
>>      CPU_CFLAGS_74kc = -mips32r2 -mtune=74kc
>
> Nothing against the patch itself. But was wondering, since the builds
> are so device specific, what's the point of building for a generic
> mips32(r2)?
>
> Isn't just
>
> CPU_CFLAGS_74kc = -march=74kc
> (which the gcc manual says implies -mtune=74kc)
>
> going to generate faster code than
>
> CPU_CFLAGS_74kc = -mips32r2 -mtune=74kc
>
> without any drawback?

Previously I also wondered why ar71xx set the CPU_TYPE to 34kc while there are
24kc SoCs like AR9331.  According to the GCC manual

  -mips32r2 is equivalent to -march=mips32r2

  ...

  By using ‘-march’ and ‘-mtune’ together, it is possible to generate
  code that will run on a family of processors, but optimize the code for one
  particular member of that family.

So I guess it's just that `-mips32r2 -mtune=74kc` is safer than
`-march=74kc`

                yousong

> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list