List Info

Thread: 64bit divide




64bit divide
user name
2006-07-06 12:52:46
Hello all,
I'm porting a VR4120A based micro to netbsd.
I've got the initial setup done, console, cache etc

But the 64bit divide isn't working right. 
This is most noticable in printf("%d\n",345);
prints
005

The remainder is OK, but not the quotient.

I've based this port on hpcmips which has the right
family of processors but is running big endian, which
none of those ports are for.

The div_d routine is in arch/mips/mips though so I would
not have thought endian had anything to do with it.

Anyone got any experience with this function, point me as
were it could be going wrong?

JP
64bit divide
user name
2006-07-09 05:12:45
jpfosterexterity.co.uk wrote:

> I'm porting a VR4120A based micro to netbsd.
> I've got the initial setup done, console, cache etc
 :
> The div_d routine is in arch/mips/mips though so I
would
> not have thought endian had anything to do with it.

I'm afraid there are few people who tried mips SOFTFLOAT
code
on big endian environment. (anyone tried it on alchemy?)

I guess you would have to add some #if _BYTE_ORDER
like locore_mips3.S to swap high/low words in some
64bit functions.

BTW, do NEC VR41xx processors work properly on big endian?
I heard a rumour that some embedded peripherals didn't work
on big endian since they were designed for WindowsCE.
---
Izumi Tsutsui
64bit divide
user name
2006-07-10 15:31:38
Izumi Tsutsui wrote:
> jpfosterexterity.co.uk wrote:
>
>   
>> I'm porting a VR4120A based micro to netbsd.
>> I've got the initial setup done, console, cache
etc
>>     
>  :
>   
>> The div_d routine is in arch/mips/mips though so I
would
>> not have thought endian had anything to do with it.
>>     
>
> I'm afraid there are few people who tried mips
SOFTFLOAT code
> on big endian environment. (anyone tried it on
alchemy?)
>   

I run alchemy little endian, because there are some ugly PCI
quirks when
it runs big endian.

I'll try to take a look at this on AR5312, which also runs
big endian.

> I guess you would have to add some #if _BYTE_ORDER
> like locore_mips3.S to swap high/low words in some
> 64bit functions.
>
> BTW, do NEC VR41xx processors work properly on big
endian?
> I heard a rumour that some embedded peripherals didn't
work
> on big endian since they were designed for WindowsCE.
>   

Alchemy PCI works far better in little endian mode.  I
don't recall the
precise details offhand, but I know it was something for
which there
wasn't a simple workaround.


    -- Garrett
> ---
> Izumi Tsutsui
>   


-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecom
puter.com/
Phone: 951 325-2134  Fax: 951 325-2191

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )