qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] TCG unit testing


From: Peter Maydell
Subject: Re: [Qemu-devel] [RFC] TCG unit testing
Date: Sun, 25 Aug 2013 18:13:13 +0100

On 23 August 2013 22:18, Richard Henderson <address@hidden> wrote:
> E.g. tci never defines TCG_TARGET_CALL_ALIGN_ARGS.  Thus if one uses tci on an
> ARM host, a helper like
>
> DEF_HELPER_FLAGS_2(store_fpcr, TCG_CALL_NO_RWG, void, env, i64)
>
> will have its arguments loaded into TCI's R0, R1, R2, and thence into the ARM
> r0, r1, r2.  But the ARM abi requires the i64 input to be aligned, and thus it
> should be r0, r2, r3.

Oh, TCI does that? That's just broken -- you can't treat all helpers the same
that way. You either need to have a bit of per-CPU glue code which knows
how to adjust things to the calling convention (which would defeat the point
of TCI being CPU-independent) or you need to defer to a library that can do
it (libffi would be the obvious choice) or you need to actually have the C
code in the interpreter make the call with all the correct argument types
(should be technically possible for qemu I guess since we have a fixed
set of helper functions and we know the types at compile time, though
it might be kind of painful).

-- PMM



reply via email to

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