Subject: Re: k0/k1 register while mulhi/mullo manipulation
To: Toru Nishimura <>
From: Jason Thorpe <>
List: port-mips
Date: 02/23/2000 11:08:26
On Wed, 23 Feb 2000 20:07:39 +0900 (JST) (Toru Nishimura) wrote:

 > My vague memory whispers me 'k0/k1 contents might be trashed under certain
 > circumstances, e.g., after calling mt*/mf* for mulhi/mullo'.  I can not
 > remember where I got the knowledge, and I might be wrong.

According to my R3000/R4000 manual, there are no restrictions on register
usage for {mf,mt}{hi,lo}, but there are restrictions on what can be done
after it.  Specifically, the two instructions following must *not* be:


k0 and k1 are just general purpose registers, as far as the CPU is
concerned.  It's merely convention how we use them :-)

Personally, I find the whole kdbaux thing to be a little suspicious...  It
occurs to me that what you really want to do is just always reserve the
space on the stack frame for the saved registers, and maybe save yourself
the work of actually saving/restoring them if you don't have DDB in the

        -- Jason R. Thorpe <>