From: Jun Sun <jsun@mvista.com>
To: Dominic Sweetman <dom@algor.co.uk>
Cc: linux-mips@oss.sgi.com, linux-mips@fnet.fr
Subject: Re: load_unaligned() and "uld" instruction
Date: Mon, 25 Sep 2000 14:36:39 -0700 [thread overview]
Message-ID: <39CFC567.DD66BC56@mvista.com> (raw)
In-Reply-To: 200009252116.WAA01137@gladsmuir.algor.co.uk
Dominic Sweetman wrote:
>
> Jun Sun (jsun@mvista.com) writes:
>
> > The USB sub-system uses "unaligned.h" file to access unaligned data.
> > All the unaligned data access functions depend on "uld" and "usw"
> > instructions, which are not available on many CPUs.
>
> You won't find the instruction 'uld' in *any* MIPS CPU.
>
> uld is an assembler macro-instruction translating into a
>
> ldl
> ldr
>
> pair (the instructions are called load-double-left and
> load-double-right). The exact translation depends on whether you're
> running big-endian or little-endian... but the 32-bit version on a
> big-endian CPU is that
>
> ulw $1, <address>
>
> is assembled as
>
> lwl $1, <address>
> lwr $1, <address+3>
>
> The way that the load-left and load-right work together is kind of
> tricky to get your head round.
>
> So far as I know, all 64-bit MIPS CPUs implement ldl/ldr and the store
> equivalents. MIPS patented these instructions, so clones like Lexra's
> don't implement the 32-bit versions (lwl, lwr etc).
>
> --
> Dominic Sweetman
> Algorithmics Ltd
> The Fruit Farm, Ely Road, Chittering, CAMBS CB5 9PH, ENGLAND
> phone: +44 1223 706200 / fax: +44 1223 706250 / http://www.algor.co.uk
Dominic,
Thanks for the clarification.
I looked at my problem again, and it turns out that it was caused by
"-mips2" compiler option. If I use "-mips3", the complain goes away,
which seems to make sense - assuming "uld" and "usw" are introduced in
mips III.
This actually brings another question (which I thought I have posted
before). Take a look of arch/mips/Makefile, you will find most CPUS
uses -mips2 compiler option. While -mips2 is safe, it cannot take
advantages of "uld" etc. Is there any reason that we don't want to use
-mips3, at least for some of the later CPUs?
If we have to use "-mips2" option, is there a clean way which allows us
to "uld/usw" instructions (instead of manually twicking the compilation
for each file that uses them)?
Another question is that in the same file most CPUs will take another
compiler option such as "-mcpu=r8000", in which case the cpu model
usually does NOT correspond to the actual CPU. Why is that?
Thanks.
Jun
next prev parent reply other threads:[~2000-09-25 21:37 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-09-25 18:48 load_unaligned() and "uld" instruction Jun Sun
2000-09-25 21:16 ` Dominic Sweetman
2000-09-25 21:36 ` Jun Sun [this message]
2000-09-25 23:29 ` Ralf Baechle
2000-09-26 6:22 ` Kevin D. Kissell
2000-09-26 6:22 ` Kevin D. Kissell
2000-09-26 9:08 ` Dominic Sweetman
2000-09-26 9:08 ` Dominic Sweetman
2000-09-29 17:22 ` Ralf Baechle
2000-10-09 14:49 ` Dominic Sweetman
2000-09-26 18:04 ` Jun Sun
2000-09-27 10:06 ` Maciej W. Rozycki
2000-10-06 0:43 ` Ralf Baechle
2000-10-06 9:54 ` Maciej W. Rozycki
2000-10-06 16:21 ` Ralf Baechle
2000-10-05 12:13 ` Ralf Baechle
2000-10-06 1:11 ` Jun Sun
2000-10-05 19:41 ` Kevin D. Kissell
2000-10-05 19:41 ` Kevin D. Kissell
2000-10-06 4:32 ` Jun Sun
2000-10-05 22:10 ` Kevin D. Kissell
2000-10-05 22:10 ` Kevin D. Kissell
2000-10-06 5:53 ` Jun Sun
2000-10-05 23:14 ` Kevin D. Kissell
2000-10-05 23:14 ` Kevin D. Kissell
2000-10-06 16:32 ` Ralf Baechle
2000-10-07 1:35 ` Jun Sun
2000-10-06 22:26 ` Ralf Baechle
2000-10-06 16:28 ` Ralf Baechle
2000-10-07 1:24 ` Jun Sun
2000-10-06 20:46 ` Kevin D. Kissell
2000-10-06 20:46 ` Kevin D. Kissell
2000-10-07 7:16 ` Jun Sun
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=39CFC567.DD66BC56@mvista.com \
--to=jsun@mvista.com \
--cc=dom@algor.co.uk \
--cc=linux-mips@fnet.fr \
--cc=linux-mips@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox