On Wed, 2016-07-27 at 12:47 +1000, David Gibson wrote:
> > +#if defined(HOST_WORDS_BIGENDIAN)
> > +        memcpy(&env->gpr[reg], src, adjlen);
> > +        reg += (adjlen >> 2);
> > +        addr = addr_add(env, addr, adjlen);
> > +#else
> > +        while(adjlen) {
> > +            env->gpr[reg++] = bswap32(*(src++));
> > +            adjlen -= 4;
> > +            addr = addr_add(env, addr, 4);
> > +        }
> > +#endif
> 
> Would it improve this any further to do the memcpy() unconditionally,
> then byteswap the GPRs in-place for the LE host case?

I thought about it and decided probably not. It's not a big enough
memcpy to matter I suspect. And it keeps the code simpler.

Cheers,
Ben.

Reply via email to