Browse files

Add some compiling optimizations

Change-Id: Ie9c39a7e3d5988547ff7b4c81302682b95e0e45d
Signed-off-by: Josue Rivera <prbassplayer@gmail.com>
  • Loading branch information...
1 parent e68f3fd commit 19980a7e386b103d2cd08b169bab2784add23184 @PRJosh PRJosh committed Mar 28, 2014
Showing with 16 additions and 7 deletions.
  1. +14 −5 Makefile
  2. +1 −1 arch/arm/Makefile
  3. +1 −1 arch/arm/vfp/Makefile
View
19 Makefile
@@ -347,11 +347,20 @@ CHECK = sparse
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void $(CF)
-CFLAGS_MODULE =
-AFLAGS_MODULE =
+
+#
+# Kernel optimizations
+#
+CFLAGS_A9 = -mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a -marm -munaligned-access -mfpu=neon -funsafe-math-optimizations
+CFLAGS_MODULO = -fmodulo-sched -fsched-spec-load -fmodulo-sched-allow-regmoves -ftree-vectorize -mvectorize-with-neon-quad -funroll-loops -fgcse-lm -fgcse-sm
+KERNEL_MODS = $(CFLAGS_A9) $(CFLAGS_MODULO)
+
+MOD_FLAGS = -DMODULE $(KERNEL_MODS)
+CFLAGS_MODULE = $(MODFLAGS)
+AFLAGS_MODULE = $(MODFLAGS)
LDFLAGS_MODULE =
-CFLAGS_KERNEL =
-AFLAGS_KERNEL =
+CFLAGS_KERNEL = $(MODFLAGS)
+AFLAGS_KERNEL = $(MODFLAGS)
CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
@@ -369,7 +378,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-Werror-implicit-function-declaration \
-Wno-format-security \
-fno-delete-null-pointer-checks \
- -mtune=cortex-a9
+ $(MODFLAGS)
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS := -D__ASSEMBLY__
View
2 arch/arm/Makefile
@@ -57,7 +57,7 @@ comma = ,
# Note that GCC does not numerically define an architecture version
# macro, but instead defines a whole series of macros which makes
# testing for a specific architecture or later rather impossible.
-arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
+arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a -mfpu=neon-vfpv4 -funsafe-math-optimizations -ftree-vectorize, -march=armv7-a -Wa$(comma)-march=armv7-a)
arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
# Only override the compiler option if ARMv6. The ARMv6K extensions are
# always available in ARMv7
View
2 arch/arm/vfp/Makefile
@@ -7,7 +7,7 @@
# ccflags-y := -DDEBUG
# asflags-y := -DDEBUG
-KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp)
+KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=neon-vfpv4 -funsafe-math-optimizations -mfloat-abi=soft)
LDFLAGS +=--no-warn-mismatch
obj-y += vfp.o

0 comments on commit 19980a7

Please sign in to comment.