Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!keith From: keith@mips.com (Keith Garrett) Newsgroups: comp.arch Subject: addressing on Mips (Was: 64 Bit addressing on R4000?) Message-ID: <5240@spim.mips.COM> Date: 29 Jun 91 18:26:51 GMT References: <14900025@hpdmd48.boi.hp.com> <880@taniwha.UUCP> Sender: news@mips.COM Organization: MIPS Computer Systems, Sunnyvale, California Lines: 35 Nntp-Posting-Host: royalty.mips.com [discussion of possible differences between 32 & 64 bit instructions deleted] In article meissner@osf.org (Michael Meissner) writes: >The other thing I've thought about is how do you do generalized >external references. On the current R[236]000's a normal (non-GP) >reference is two instructions: > > lui $at,addr>>16 > ,addr&0xffff($at) this won't work in the general case. the offset is sign-extended before it is added to the base register contents. here is the general solution: lui $at,(addr>>16)&0xffff ori $at,addr&0xffff ,0($at) > >I wonder whether we will need four instructions in the 64 bit >universe. how about: lui $at,(addr>>48)&0xffff ori $at,(addr>>32)&0xffff sll $at,16 ori $at,(addr>>16)&0xffff sll $at,16 ori $at,addr&0xffff ,0($at) there may be a better solution for this, that i haven't considered. an alternative for either case: $at,offset($gp) ,0($at) this requires an extra memory reference, but is probably an overall win for 64 bits, and is OK for 32 bits. -- Keith Garrett "This is *MY* opinion, OBVIOUSLY" (408) 524-8110 Mips Computer Systems, 930 Arques Ave MS 1-02, Sunnyvale, Ca. 94088-3650 "Beware of the half-truth - you may have gotten hold of the wrong half." keith@mips.com -or- {ames,decwrl,prls}!mips!keith -Rabbi Seymour Essrog