From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org, Thiemo Seufer <ths@networkno.de>
Subject: Re: [Qemu-devel] [MIPS][PATCH] Fix mfc0 and dmtc0 instructions on MIPS64
Date: Sun, 13 May 2007 16:57:42 +0200 [thread overview]
Message-ID: <46472766.5090209@aurel32.net> (raw)
In-Reply-To: <20070513143749.GB8380@networkno.de>
Thiemo Seufer a écrit :
> Aurelien Jarno wrote:
>> Hi all,
>>
>> The patch below fixes the mfc0 and dmtc0 instructions for the
>> MIPS64 target:
>>
>> - The mfc0 instruction should return the 32 lowest bits of the
>> coprocessor 0 register sign extended to 64-bit.
>
> Agreed, and I think it doess already. (The places where you added
> casts read fron 32bit wide registers anyway.)
Oops, I haven't seen before that those registers were declared as
int32_t, so that the sign extension is already done.
Forget that part.
>> - The mtc0 instruction should do the same as the dmtc0 instruction for
>> 64-bit coprocessor registers instead of copying only the low 32 bits.
>
> I'm not entirely sure about this, but it feels wrong, as mtc0 should
> have the same behaviour as on 32bit CPUs. What prompted the change here?
The MIPS64 ISA manual:
Operation:
data GPR[rt]
if (Width(CPR[0,rd,sel]) = 64) then
CPR[0,rd,sel] data
else
CPR[0,rd,sel] data31..0
endif
But it is also need if you need to run a 32-bit kernel on MIPS64. For
example the EntryHi register is a 64-bit register, and the higher 32
bits (and most notably the R part of this register) has to be filled.
This part is initialised when an exception occurs, so even if a 32-bit
kernel don't know about it, it already holds the correct values.
>> - The XContest register does not exists on MIPS32 CPU.
>
> Indeed, but simply not wiring up the instruction decoding for 32bit
> should be good enough, no need to #ifdef everything.
>
Ok.
Bye,
Aurelien
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
next prev parent reply other threads:[~2007-05-13 15:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-12 14:47 [Qemu-devel] [MIPS][PATCH] Fix mfc0 and dmtc0 instructions on MIPS64 Aurelien Jarno
2007-05-13 14:37 ` Thiemo Seufer
2007-05-13 14:57 ` Aurelien Jarno [this message]
2007-05-13 17:05 ` Aurelien Jarno
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=46472766.5090209@aurel32.net \
--to=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
--cc=ths@networkno.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.