linux-mips-fnet
[Top] [All Lists]

Re: load_unaligned() and "uld" instruction

To: Jun Sun <jsun@mvista.com>
Subject: Re: load_unaligned() and "uld" instruction
From: Ralf Baechle <ralf@oss.sgi.com>
Date: Thu, 5 Oct 2000 14:13:54 +0200
Cc: "Kevin D. Kissell" <kevink@mips.com>, Dominic Sweetman <dom@algor.co.uk>, linux-mips@oss.sgi.com, linux-mips@fnet.fr
In-reply-to: <39D0E51C.79A0BE50@mvista.com>; from jsun@mvista.com on Tue, Sep 26, 2000 at 11:04:12AM -0700
References: <39CF9DFC.F30B302B@mvista.com> <200009252116.WAA01137@gladsmuir.algor.co.uk> <39CFC567.DD66BC56@mvista.com> <000d01c02782$32d31560$0deca8c0@Ulysses> <39D0E51C.79A0BE50@mvista.com>
On Tue, Sep 26, 2000 at 11:04:12AM -0700, Jun Sun wrote:

> > > 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)?
> >
> 
> Ralf, before the perfect solution is found, the following patch makes
> the gcc complain go away.  It just use ".set mips3" pragma.

It's still perfectly broken.  Uld is a 64-bit instruction meaning you still
could get into problems with register corruption or even reserved instruction
exceptions on 32-bit cpus.  Not too mention that nobody did notice that
the constraints of the inline assembler were broken for all access sizes
plus a cast that would have cut off the upper 32 bit of a 64 bit access in
any case.  That's fixed now.

> I am pretty close to get USB running with the v2.4-test5.  The unaligned
> access is the minor problem.  The bigger problem I am fighting with now
> is bus_to_virt()/virt_to_bus() and USB interrupt.

The unaligned exception handler is fairly expensive.  I suggest you should
try to get proper alignment and where that is not possible go through
the entire code and use get_unaligned.  It's going to make a noticable
difference in performance.

  Ralf

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