qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH 23/36] target/arm: Convert Neon 64-bit element 3-reg-same ins


From: Richard Henderson
Subject: Re: [PATCH 23/36] target/arm: Convert Neon 64-bit element 3-reg-same insns
Date: Fri, 1 May 2020 08:50:25 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 5/1/20 8:36 AM, Peter Maydell wrote:
> On Thu, 30 Apr 2020 at 21:54, Richard Henderson
> <address@hidden> wrote:
>> You can morph this into the gvec interface like so:
>>
>> #define DO_3SAME_64(INSN, FUNC) \
>>     static void gen_##INSN##_3s(unsigned vece, uint32_t rd_ofs,
>>                                 uint32_t rn_ofs, uint32_t rm_ofs,
>>                                 uint32_t oprsz, uint32_t maxsz)
>>     {
>>         static const GVecGen3 op = { .fni8 = FUNC };
>>         tcg_gen_gvec_3(rd_ofs, rn_ofs, rm_ofs,
>>                        oprsz, maxsz, &op);
>>     }
>>     DO_3SAME(INSN, gen_##INSN##_3s)
>>
>> The .fni8 function tells gvec that we have a helper that processes the
>> operation in 8 byte chunks.  It will handle the pass loop for you.
>>
>> There's also a .fni4 member, for those neon helpers that operate on 4-byte
>> quantities, fwiw.
> 
> Is there a version of this that works on functions that need
> to be passed the cpu_env, or do I have to create a trampoline
> function that just calls the real helper function passing it
> the extra argument ?

A trampoline is required.

The original intention of the hook is to expand some inline tcg ops.  That it
can be used to call a helper is a happy accident.  For a helper that needs env,
ideally we would use tcg_gen_gvec_ptr and handle the vector with one call.


r~



reply via email to

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