qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v4 00/29] Hexagon patch series


From: Eric Blake
Subject: Re: [RFC PATCH v4 00/29] Hexagon patch series
Date: Tue, 29 Sep 2020 16:28:47 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 9/29/20 3:11 PM, Taylor Simpson wrote:

> Ouch!  4.8 is old enough that it doesn't support C11 _Generic which I am 
> using.  That needs at least GCC 4.9.
> 
> Here are a couple of examples.  As you can see, _Generic is used to dispatch 
> to slightly different TCG generation functions depending on the type of the 
> operands.  I will scratch my head and figure out a different way to do this.
> 
> #define MEM_STORE1_FUNC(X) \
>     _Generic((X), int : gen_store1i, TCGv_i32 : gen_store1)
> #define MEM_STORE1(VA, DATA, SLOT) \
>     MEM_STORE1_FUNC(DATA)(cpu_env, VA, DATA, ctx, SLOT)

See if you can use __builtin_choose_expr() instead.  Look at
include/osdep/atomic.h which defines typeof_strip_qual() without
_Generic.  linux-user/qemu.h __put_user_e() is also an example of what
appears to be a poor-man's replacement to _Generic.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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