[U-Boot-Users] [MIPS] CPU-dependent compiler/assembler options for optimization

We take the same options as Linux for now. This means that an ancient -mcpu support will be lost. Users need gcc 3.0.X or later.
Signed-off-by: Shinya Kuribayashi skuribay@ruby.dti.ne.jp ---
cpu/mips/config.mk | 38 +++++++++++++++++++++++++++++++------- 1 files changed, 31 insertions(+), 7 deletions(-)
diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk index a173c54..8df5e23 100644 --- a/cpu/mips/config.mk +++ b/cpu/mips/config.mk @@ -20,13 +20,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # -v=$(shell $(AS) --version | grep 'GNU assembler' | egrep -o '2.[0-9.]+' | cut -d. -f2) -MIPSFLAGS:=$(shell \ -if [ "$v" -lt "14" ]; then \ - echo "-mcpu=4kc"; \ -else \ - echo "-march=4kc -mtune=4kc"; \ -fi)
ifneq (,$(findstring 4KCle,$(CROSS_COMPILE))) ENDIANNESS = -EL @@ -37,3 +30,34 @@ endif MIPSFLAGS += $(ENDIANNESS)
PLATFORM_CPPFLAGS += $(MIPSFLAGS) + +# +# CPU-dependent compiler/assembler options for optimization. +# +cflags-$(CONFIG_CPU_R3000) += -march=r3000 +cflags-$(CONFIG_CPU_TX39XX) += -march=r3900 +cflags-$(CONFIG_CPU_R6000) += -march=r6000 -Wa,--trap +cflags-$(CONFIG_CPU_R4300) += -march=r4300 -Wa,--trap +cflags-$(CONFIG_CPU_VR41XX) += -march=r4100 -Wa,--trap +cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap +cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap +cflags-$(CONFIG_CPU_LOONGSON2) += -march=r4600 -Wa,--trap +cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) -Wa,-mips32 -Wa,--trap +cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) -Wa,-mips32r2 -Wa,--trap +cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) -Wa,-mips64 -Wa,--trap +cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) -Wa,-mips64r2 -Wa,--trap +cflags-$(CONFIG_CPU_R5000) += -march=r5000 -Wa,--trap +cflags-$(CONFIG_CPU_R5432) += $(call cc-option,-march=r5400,-march=r5000) -Wa,--trap +cflags-$(CONFIG_CPU_R5500) += $(call cc-option,-march=r5500,-march=r5000) -Wa,--trap +cflags-$(CONFIG_CPU_NEVADA) += $(call cc-option,-march=rm5200,-march=r5000) -Wa,--trap +cflags-$(CONFIG_CPU_RM7000) += $(call cc-option,-march=rm7000,-march=r5000) -Wa,--trap +cflags-$(CONFIG_CPU_RM9000) += $(call cc-option,-march=rm9000,-march=r5000) -Wa,--trap +cflags-$(CONFIG_CPU_SB1) += $(call cc-option,-march=sb1,-march=r5000) -Wa,--trap +cflags-$(CONFIG_CPU_R8000) += -march=r8000 -Wa,--trap +cflags-$(CONFIG_CPU_R10000) += $(call cc-option,-march=r10000,-march=r8000) -Wa,--trap + +cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,) +cflags-$(CONFIG_CPU_R4400_WORKAROUNDS) += $(call cc-option,-mfix-r4400,) +cflags-$(CONFIG_CPU_DADDI_WORKAROUNDS) += $(call cc-option,-mno-daddi,) + +PLATFORM_CPPFLAGS += $(cflags-y)

In message 48381C45.2020801@ruby.dti.ne.jp you wrote:
We take the same options as Linux for now. This means that an ancient -mcpu support will be lost. Users need gcc 3.0.X or later.
Why is this change necessary?
There are still people out there who use ancient toolchains like gcc-2.95. Do we really have to break compatibility here?
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
In message 48381C45.2020801@ruby.dti.ne.jp you wrote:
We take the same options as Linux for now. This means that an ancient -mcpu support will be lost. Users need gcc 3.0.X or later.
Why is this change necessary?
Not necessary.
There are still people out there who use ancient toolchains like gcc-2.95. Do we really have to break compatibility here?
This patch adds, - support more CPU variants other than MIPS 4K - without changing the code.
In other words, every U-Boot/MIPS user other than MIPS 4K must change cpu/mips/config.mk as he wants.
I thought this patch is more beneficial for MIPS users even if breaking old gcc 2.96 support. That's all.
I don't want to argue with you about this issue. If you disagree, I'll drop this from my queue. I don't mind, I can live without this change.
Shinya

Dear Shinya,
in message 4839885F.6070801@ruby.dti.ne.jp you wrote:
There are still people out there who use ancient toolchains like gcc-2.95. Do we really have to break compatibility here?
This patch adds,
- support more CPU variants other than MIPS 4K
- without changing the code.
In other words, every U-Boot/MIPS user other than MIPS 4K must change cpu/mips/config.mk as he wants.
I thought this patch is more beneficial for MIPS users even if breaking old gcc 2.96 support. That's all.
Maybe you can implement this in a way that still supports old environments at least at the same level as the current code does?
I don't want to argue with you about this issue. If you disagree, I'll drop this from my queue. I don't mind, I can live without this change.
Please don't misunderstand me - I don't want to stop you or to put obstacles in your way. I just want to make sure we keep the bigger picture in mind.
Best regards,
Wolfgang Denk
participants (2)
-
Shinya Kuribayashi
-
Wolfgang Denk