summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@mips.com>2018-11-08 02:19:41 +0300
committerPaul Burton <paul.burton@mips.com>2018-11-08 21:23:38 +0300
commita013ba392843b2f65088f198a7125a78d48c6533 (patch)
treeae2b4c23c48f0c046ba9919a8c7461e9f867ba39 /arch
parentd08b8ccc476215ceee6e3370f0c1732d5f83f5ef (diff)
downloadlinux-a013ba392843b2f65088f198a7125a78d48c6533.tar.xz
MIPS: Hardcode cpu_has_mmips=1 for microMIPS kernels
If we built the kernel targeting the microMIPS ISA then the very fact that the kernel is running implies that the CPU supports microMIPS. Thus we can hardcode cpu_has_mmips to 1 allowing the compiler greater scope for optimisation due to the compile-time constant. Signed-off-by: Paul Burton <paul.burton@mips.com> Patchwork: https://patchwork.linux-mips.org/patch/21022/ Cc: linux-mips@linux-mips.org
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/cpu-features.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index 0edba3e75747..8669fdb503a5 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -195,7 +195,9 @@
#endif
#ifndef cpu_has_mmips
-# ifdef CONFIG_SYS_SUPPORTS_MICROMIPS
+# if defined(__mips_micromips)
+# define cpu_has_mmips 1
+# elif defined(CONFIG_SYS_SUPPORTS_MICROMIPS)
# define cpu_has_mmips __opt(MIPS_CPU_MICROMIPS)
# else
# define cpu_has_mmips 0