Some of the more complex instructions need a lot of operands. Here's an example if (Pv4) memb(Rs32 + Ru32 << #u2) = Rt32 This is a predicated store with 5 operands: Pv4predicate Rs32, Ru32, u2used to compute the effective address Rt32value to store In addition, every helper gets an env argument, and predicated instructions get a "slot" argument. The slot argument refers to the VLIW slot where the instruction is located within the packet. It is used for predicated instructions to communicate to the end-of-packet handling to determine whether the instruction should commit.
So, the signature for the helper for this instruction is void HELPER(S4_pstorerbt_rr)(CPUHexagonState *env, int32_t PvV, int32_t RsV, int32_t RuV, int32_t RtV, int32_t uiV, uint32_t slot) HTH, Taylor > -----Original Message----- > From: Richard Henderson <rth7...@gmail.com> On Behalf Of Richard > Henderson > Sent: Thursday, February 6, 2020 4:29 AM > To: Taylor Simpson <tsimp...@quicinc.com>; qemu-devel@nongnu.org > Cc: Paolo Bonzini <pbonz...@redhat.com> > Subject: Re: [PATCH] Add support for a helper with 7 arguments > > ------------------------------------------------------------------------- > CAUTION: This email originated from outside of the organization. > ------------------------------------------------------------------------- > > On 2/6/20 6:02 AM, Richard Henderson wrote: > > On 2/5/20 10:41 PM, Taylor Simpson wrote: > >> Currently, helpers can only take up to 6 arguments. This patch adds the > >> capability for up to 7 arguments. I have tested it with the Hexagon port > >> that I am preparing for submission. > > > > This is not safe, in general, without other changes. > > > >>From include/tcg/tcg.h: > > > >> /* While we limit helpers to 6 arguments, for 32-bit hosts, with padding, > >> this imples a max of 6*2 (64-bit in) + 2 (64-bit out) = 14 operands. > >> There are never more than 2 outputs, which means that we can store all > >> dead + sync data within 16 bits. */ > >> #define DEAD_ARG 4 > >> #define SYNC_ARG 1 > >> typedef uint16_t TCGLifeData; > > > > Thus 7 uint64_t inputs, on a 32-bit host, will overflow TCGLifeData. > > My bad, no it won't. For some reason I had two outputs in my head, but > they'll > both be uint32_t not two uint64_t. 7 uint64_t inputs with 1 uint64_t output > will *just* fit. > > > > What are you doing that requires so many arguments? > > But I'd still like to know why you need so many. > > > r~