qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [Qemu-commits] [COMMIT 968a40f] microblaze: Trap on una


From: Edgar E. Iglesias
Subject: [Qemu-devel] Re: [Qemu-commits] [COMMIT 968a40f] microblaze: Trap on unaligned data accesses.
Date: Thu, 3 Sep 2009 22:01:02 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Thu, Sep 03, 2009 at 09:10:40PM +0300, Blue Swirl wrote:
> On Thu, Sep 3, 2009 at 2:11 PM, Anthony Liguori<address@hidden> wrote:
> > From: Edgar E. Iglesias <address@hidden>
> 
> > +void helper_memalign(uint32_t addr, uint32_t dr, uint32_t wr, uint32_t 
> > size)
> > +{
> > +    uint32_t mask;
> > +
> > +    switch (size) {
> > +        case 4: mask = 3; break;
> > +        case 2: mask = 1; break;
> > +        default:
> > +        case 1: mask = 0; break;
> > +    }
> 
> For additional performance (and to avoid the check for mask == 0 case
> ;-)), you could perform most of the math above during translation.

Thanks, I beleive part of what you say is already done. The case 1
is there for completeness but translate.c doesn't call the helper for
size 1.

I'll move the computing of the mask into translate.c.

Thanks,
Edgar

> 
> Sparc32 actually avoids most of these explicit tests, but I still
> can't understand Fabrice's magic that made it possible.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]