[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [RFC PATCH v4 00/29] Hexagon patch series
From: |
Taylor Simpson |
Subject: |
RE: [RFC PATCH v4 00/29] Hexagon patch series |
Date: |
Tue, 29 Sep 2020 22:16:35 +0000 |
> -----Original Message-----
> From: Eric Blake <eblake@redhat.com>
> Sent: Tuesday, September 29, 2020 3:29 PM
> To: Taylor Simpson <tsimpson@quicinc.com>; Philippe Mathieu-Daudé
> <f4bug@amsat.org>; qemu-devel@nongnu.org
> Cc: ale@rev.ng; riku.voipio@iki.fi; richard.henderson@linaro.org;
> laurent@vivier.eu; aleksandar.m.mail@gmail.com
> Subject: Re: [RFC PATCH v4 00/29] Hexagon patch series
>
> 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.
Thanks! It's a pretty straightforward translation for my use cases
#define MEM_STORE1_FUNC(X) \
__builtin_choose_expr(__builtin_types_compatible_p(typeof(X), int), \
gen_store1i, \
gen_store1)
#define MEM_STORE1(VA, DATA, SLOT) \
MEM_STORE1_FUNC(DATA)(cpu_env, VA, DATA, ctx, SLOT)
Taylor
- Re: [RFC PATCH v4 27/29] Hexagon (linux-user/hexagon) Linux user emulation, (continued)
- [RFC PATCH v4 28/29] Hexagon (tests/tcg/hexagon) TCG tests, Taylor Simpson, 2020/09/28
- Re: [RFC PATCH v4 00/29] Hexagon patch series, no-reply, 2020/09/28
- Re: [RFC PATCH v4 00/29] Hexagon patch series, no-reply, 2020/09/28
- Re: [RFC PATCH v4 00/29] Hexagon patch series, Philippe Mathieu-Daudé, 2020/09/29
- Re: [RFC PATCH v4 00/29] Hexagon patch series, Brad Smith, 2020/09/30