qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v1 22/22] target/i386: reimplement (V)P(EQ,


From: Jan Bobek
Subject: Re: [Qemu-devel] [RFC PATCH v1 22/22] target/i386: reimplement (V)P(EQ, CMP)(B, W, D)
Date: Fri, 2 Aug 2019 10:07:06 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 7/31/19 5:31 PM, Richard Henderson wrote:
> On 7/31/19 1:09 PM, Aleksandar Markovic wrote:
>>
>>
>> On Wed, Jul 31, 2019 at 9:51 PM Richard Henderson <address@hidden
>> <mailto:address@hidden>> wrote:
>>
>>     On 7/31/19 10:57 AM, Jan Bobek wrote:
>>     > +static inline void gen_gvec_cmpeq(unsigned vece, uint32_t dofs,
>>     > +                                  uint32_t aofs, uint32_t bofs,
>>     > +                                  uint32_t oprsz, uint32_t maxsz)
>>     > +{
>>     > +    tcg_gen_gvec_cmp(TCG_COND_EQ, vece, dofs, aofs, bofs, oprsz, 
>> maxsz);
>>     > +}
>>     ...
>>     > +static inline void gen_gvec_cmpgt(unsigned vece, uint32_t dofs,
>>     > +                                  uint32_t aofs, uint32_t bofs,
>>     > +                                  uint32_t oprsz, uint32_t maxsz)
>>     > +{
>>     > +    tcg_gen_gvec_cmp(TCG_COND_GT, vece, dofs, aofs, bofs, oprsz, 
>> maxsz);
>>     > +}
>>
>>     Drop the inlines.
>>
>>
>> Why? The compiler will decide at the end of the day, but at least "inline" 
>> here
>> says that the code author thinks that inlining is desirable, logical, and 
>> expected
>> in these cases, which is in turn a valuable information for the code reader.
> 
> In this case it is in fact a lie that will only confuse the reader, as it did
> you.  Functions whose address are passed as a callback, as these are, are
> always forced out of line.
> 
> But beyond that, clang diagnoses unused static inline within *.c while gcc 
> does
> not (I'm not sure I agree with clang, but it is what it is).  By leaving off
> the inline, but compilers will diagnose when code rearrangement leaves a
> function unused.

Dang, I completely forgot about the function-address vs. inlining rule. I 
thought
of these as macros, really; they are only functions because I needed to pass
them to the gen_gvec_ld_modrm_* helpers.

I'll drop the inline, compilers ignore it anyway.

-Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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