# CPU tuning section - shared with UML. # Must change only cflags-y (or [yn]), not CFLAGS! That makes a difference for UML. #-mtune exists since gcc 3.4 HAS_MTUNE := $(call cc-option-yn, -mtune=i386) ifeq ($(HAS_MTUNE),y) tune = $(call cc-option,-mtune=$(1),$(2)) else tune = $(call cc-option,-mcpu=$(1),$(2)) endif align := $(cc-option-align) cflags-$([31mCONFIG_M486[0m) += -march=i486 cflags-$([31mCONFIG_M586[0m) += -march=i586 cflags-$([31mCONFIG_M586TSC[0m) += -march=i586 cflags-$([31mCONFIG_M586MMX[0m) += -march=pentium-mmx cflags-$([31mCONFIG_M686[0m) += -march=i686 cflags-$([31mCONFIG_MPENTIUMII[0m) += -march=i686 $(call tune,pentium2) cflags-$([31mCONFIG_MPENTIUMIII[0m) += -march=i686 $(call tune,pentium3) cflags-$([31mCONFIG_MPENTIUMM[0m) += -march=i686 $(call tune,pentium3) cflags-$([31mCONFIG_MPENTIUM4[0m) += -march=i686 $(call tune,pentium4) cflags-$([31mCONFIG_MK6[0m) += -march=k6 # Please note, that patches that add -march=athlon-xp and friends are pointless. # They make zero difference whatsosever to performance at this time. cflags-$([31mCONFIG_MK7[0m) += -march=athlon cflags-$([31mCONFIG_MK8[0m) += $(call cc-option,-march=k8,-march=athlon) cflags-$([31mCONFIG_MCRUSOE[0m) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 cflags-$([31mCONFIG_MEFFICEON[0m) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 cflags-$([31mCONFIG_MWINCHIPC6[0m) += $(call cc-option,-march=winchip-c6,-march=i586) cflags-$([31mCONFIG_MWINCHIP3D[0m) += $(call cc-option,-march=winchip2,-march=i586) cflags-$([31mCONFIG_MCYRIXIII[0m) += $(call cc-option,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 cflags-$([31mCONFIG_MVIAC3_2[0m) += $(call cc-option,-march=c3-2,-march=i686) cflags-$([31mCONFIG_MVIAC7[0m) += -march=i686 cflags-$([31mCONFIG_MCORE2[0m) += -march=i686 $(call tune,core2) cflags-$([31mCONFIG_MATOM[0m) += $(call cc-option,-march=atom,$(call cc-option,-march=core2,-march=i686)) \ $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic)) # AMD Elan support cflags-$([31mCONFIG_MELAN[0m) += -march=i486 # Geode GX1 support cflags-$([31mCONFIG_MGEODEGX1[0m) += -march=pentium-mmx cflags-$([31mCONFIG_MGEODE_LX[0m) += $(call cc-option,-march=geode,-march=pentium-mmx) # add at the end to overwrite eventual tuning options from earlier # cpu entries cflags-$([31mCONFIG_X86_GENERIC[0m) += $(call tune,generic,$(call tune,i686)) # Work around the pentium-mmx code generator madness of gcc4.4.x which # does stack alignment by generating horrible code _before_ the mcount # prologue (push %ebp, mov %esp, %ebp) which breaks the function graph # tracer assumptions. For i686, generic, core2 this is set by the # compiler anyway ifeq ($([31mCONFIG_FUNCTION_GRAPH_TRACER[0m), y) ADD_ACCUMULATE_OUTGOING_ARGS := y endif # Work around to a bug with asm goto with first implementations of it # in gcc causing gcc to mess up the push and pop of the stack in some # uses of asm goto. ifeq ($([31mCONFIG_JUMP_LABEL[0m), y) ADD_ACCUMULATE_OUTGOING_ARGS := y endif cflags-$(ADD_ACCUMULATE_OUTGOING_ARGS) += $(call cc-option,-maccumulate-outgoing-args) # Bug fix for binutils: this option is required in order to keep # binutils from generating NOPL instructions against our will. ifneq ($([31mCONFIG_X86_P6_NOP[0m),y) cflags-y += $(call cc-option,-Wa$(comma)-mtune=generic32,) endif |