diff mbox

[07/10] mips64-linux-user: Use MIPS64R2-generic as default cpu.

Message ID 1360521050-29680-8-git-send-email-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson Feb. 10, 2013, 6:30 p.m. UTC
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

I don't actually recall why this patch was in my old tree.  It might
just have been that I wanted a mips64r2 part for testing and didn't
want to keep specifying -cpu on the command-line.  OTOH, I don't see
any reason not to emulate as many ISA extensions as possible by default.


r~

Comments

Peter Maydell Feb. 11, 2013, 5:38 p.m. UTC | #1
On 10 February 2013 18:30, Richard Henderson <rth@twiddle.net> wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  linux-user/main.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> I don't actually recall why this patch was in my old tree.  It might
> just have been that I wanted a mips64r2 part for testing and didn't
> want to keep specifying -cpu on the command-line.  OTOH, I don't see
> any reason not to emulate as many ISA extensions as possible by default.

I think a better approach to the "usermode wants to enable all the
ISA extensions we know about" is the '-cpu any' approach used by
several of our targets including ARM, unless there's a reason that
wouldn't work for MIPS too?

-- PMM
Aurelien Jarno March 5, 2013, 11:18 a.m. UTC | #2
On Sun, Feb 10, 2013 at 10:30:47AM -0800, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  linux-user/main.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> I don't actually recall why this patch was in my old tree.  It might
> just have been that I wanted a mips64r2 part for testing and didn't
> want to keep specifying -cpu on the command-line.  OTOH, I don't see
> any reason not to emulate as many ISA extensions as possible by default.
> 
> 
> r~
> 
> 
> 
> diff --git a/linux-user/main.c b/linux-user/main.c
> index 3a3be70..8c4dffd 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -3525,7 +3525,9 @@ int main(int argc, char **argv, char **envp)
>          cpu_model = "Fujitsu MB86904";
>  #endif
>  #elif defined(TARGET_MIPS)
> -#if defined(TARGET_ABI_MIPSN32) || defined(TARGET_ABI_MIPSN64)
> +#if defined(TARGET_ABI_MIPSN64)
> +        cpu_model = "MIPS64R2-generic";
> +#elif defined(TARGET_ABI_MIPSN32)
>          cpu_model = "20Kc";
>  #else
>          cpu_model = "24Kf";

Why switching only N64 and not also for N32? The same way we should also
switch the O32 one to 74Kf which also has DSP R2 and MIPS16.

That looks fine only as a first step, otherwise the idea of having an
"any" CPU, as suggested by Peter, looks like a good idea. That said some
instruction set conflicts so we can't enable all of them in such a CPU.
The name "any" can be a bit misleading in that case. Is it also the case
on other architectures?
diff mbox

Patch

diff --git a/linux-user/main.c b/linux-user/main.c
index 3a3be70..8c4dffd 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3525,7 +3525,9 @@  int main(int argc, char **argv, char **envp)
         cpu_model = "Fujitsu MB86904";
 #endif
 #elif defined(TARGET_MIPS)
-#if defined(TARGET_ABI_MIPSN32) || defined(TARGET_ABI_MIPSN64)
+#if defined(TARGET_ABI_MIPSN64)
+        cpu_model = "MIPS64R2-generic";
+#elif defined(TARGET_ABI_MIPSN32)
         cpu_model = "20Kc";
 #else
         cpu_model = "24Kf";