linux-mips
[Top] [All Lists]

RE: Question about generic\time.c 2.4.17

To: "Zajerko-McKee, Nick" <nmckee@telogy.com>
Subject: RE: Question about generic\time.c 2.4.17
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Date: Wed, 24 Jul 2002 17:19:54 +0200 (MET DST)
Cc: linux-mips@oss.sgi.com
In-reply-to: <37A3C2F21006D611995100B0D0F9B73CBFE202@tnint11.telogy.design.ti.com>
Organization: Technical University of Gdansk
Sender: owner-linux-mips@oss.sgi.com
On Wed, 24 Jul 2002, Zajerko-McKee, Nick wrote:

> Thanks for the reply.   No, the code wasn't too obvious.  I went through the
> gas info page to try to understand the inline assembler options + see mips
> run.  I believe the code is used in the MIPS32 condition, which is what mode
> I'm building for...  

 For the 32-bit mode, not necessarily on a MIPS32 processor. 

> so the result is res = (high |low)/ base ?

 Strictly speaking, res = (high:low) / base and the result is (high:low) %
base.  That's a macro, hence a bit weird semantics (two results are
actually provided), but it makes the use easier.  A few architectures
provide such an operation in hardware.

> What had me confused was high and low are also modified as part of the
> function.

 That's just how the algorithm works.  These are local variables anyway.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


<Prev in Thread] Current Thread [Next in Thread>