Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] MIPS: Hardcode cpu_has_mmips=1 for microMIPS kernels
@ 2018-11-07 23:19 Paul Burton
  2018-11-13 22:22 ` Paul Burton
  2018-11-28  3:10 ` Maciej W. Rozycki
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Burton @ 2018-11-07 23:19 UTC (permalink / raw)
  To: linux-mips@linux-mips.org; +Cc: Paul Burton

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>
---

 arch/mips/include/asm/cpu-features.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-29 14:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-07 23:19 [PATCH] MIPS: Hardcode cpu_has_mmips=1 for microMIPS kernels Paul Burton
2018-11-13 22:22 ` Paul Burton
2018-11-13 22:22   ` Paul Burton
2018-11-28  3:10 ` Maciej W. Rozycki
2018-11-28 22:33   ` Paul Burton
2018-11-29 14:04     ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox