From: Paul Burton <paul.burton@mips.com>
To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
Cc: Paul Burton <pburton@wavecomp.com>
Subject: [PATCH] MIPS: Hardcode cpu_has_mmips=1 for microMIPS kernels
Date: Wed, 7 Nov 2018 23:19:41 +0000 [thread overview]
Message-ID: <20181107231931.6136-1-paul.burton@mips.com> (raw)
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
next reply other threads:[~2018-11-07 23:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 23:19 Paul Burton [this message]
2018-11-13 22:22 ` [PATCH] MIPS: Hardcode cpu_has_mmips=1 for microMIPS kernels 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181107231931.6136-1-paul.burton@mips.com \
--to=paul.burton@mips.com \
--cc=linux-mips@linux-mips.org \
--cc=pburton@wavecomp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).