[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 00/93] TCI fixes and cleanups
From: |
Richard Henderson |
Subject: |
Re: [PATCH v2 00/93] TCI fixes and cleanups |
Date: |
Thu, 4 Feb 2021 10:42:17 -1000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 2/4/21 10:02 AM, Stefan Weil wrote:
> Is there a Git repository which makes pulling all changes easier?
https://gitlab.com/rth7680/qemu/-/tree/tci-next
> Regarding misaligned bytecode access, there exist two solutions. We could
> either use code which handles that correctly (I had sent a patch using memcpy
> two years ago and recently sent a V2 which uses the QEMU standard functions
> for
> that). Or we can align the data like it is done in Richard's patches. For me
> it
> is not obvious which one is better.
I think it is obvious. If a host requires aligned access, a single aligned
load requires only one instruction, and an unaligned access requires lots.
E.g., for sparc,
int foo(void *p)
{
int x;
__builtin_memcpy(&x, p, 4);
return x;
}
ldub [%i0], %g3
ldub [%i0+1], %g2
stb %g3, [%fp+2043]
stb %g2, [%fp+2044]
ldub [%i0+2], %g3
ldub [%i0+3], %g2
stb %g3, [%fp+2045]
stb %g2, [%fp+2046]
ldsw [%fp+2043], %i0
Such unaligned accesses are *really* slow.
> While a single access is faster for aligned
> data, this might be different for sequential access on misaligned data which
> might profit from better caching of smaller bytecode.
I believe you'll find that the rewrite encoding is smaller already.
r~
- [PATCH v2 87/93] tcg/tci: Implement goto_ptr, (continued)
- [PATCH v2 87/93] tcg/tci: Implement goto_ptr, Richard Henderson, 2021/02/03
- [PATCH v2 88/93] tcg/tci: Implement movcond, Richard Henderson, 2021/02/03
- [PATCH v2 89/93] tcg/tci: Implement andc, orc, eqv, nand, nor, Richard Henderson, 2021/02/03
- [PATCH v2 90/93] tcg/tci: Implement extract, sextract, Richard Henderson, 2021/02/03
- [PATCH v2 91/93] tcg/tci: Implement clz, ctz, ctpop, Richard Henderson, 2021/02/03
- [PATCH v2 92/93] tcg/tci: Implement mulu2, muls2, Richard Henderson, 2021/02/03
- [PATCH v2 93/93] tcg/tci: Implement add2, sub2, Richard Henderson, 2021/02/03
- Re: [PATCH v2 00/93] TCI fixes and cleanups, no-reply, 2021/02/03
- Re: [PATCH v2 00/93] TCI fixes and cleanups, Peter Maydell, 2021/02/04