> From: Anton Johansson <a...@rev.ng> 
> Sent: Monday, October 18, 2021 6:23 AM
> To: Taylor Simpson <tsimp...@quicinc.com>; Alessandro Di Federico 
> <ale.q...@rev.ng>; qemu-devel@nongnu.org
> Cc: Brian Cain <bc...@quicinc.com>; bab...@rev.ng; ni...@rev.ng; 
> richard.hender...@linaro.org; Alessandro Di Federico <a...@rev.ng>
> Subject: Re: [PATCH v6 07/12] target/hexagon: prepare input for the 
> idef-parser
>
> On 9/7/21 18:09, Taylor Simpson wrote:
> +#define fADDSAT64(DST, A, B)                                            \
> +    __a = fCAST8u(A);                                                   \
> +    __b = fCAST8u(B);                                                   \
> +    __sum = __a + __b;                                                  \
> +    __xor = __a ^ __b;                                                  \
> +    __mask = fCAST8s(0x8000000000000000ULL);                            \
> +    if (((__a ^ __b) | ~(__a ^ __sum)) & __mask) {                      \
> +        DST = __sum;                                                    \
> +    } else {                                                            \
> +        DST = ((__sum & __mask) >> 63) + __mask;                        \
> +        fSET_OVERFLOW();                                                \
> +    }
> There are a bunch of these with pretty complex semantics.  Wouldn't it be 
> easier to recognize them in the parser and call a hand-written helper?
> 
> These macro redefinitions are needed to work with the auto type system in 
> idef-parser. We can drop these specializations in the upcoming patchset where 
> we parse fHIDE declarations. 
> If we still want to resort to helpers here, it's probably better to exclude 
> instructions using fADDSAT64 (and similar) directly, and fallback on 
> helpers/overrides for those instructions.

Sorry, I wasn't clear.  I meant a hand-written function to generate the TCG 
code - not a qemu TCG helper.

Thanks,
Taylor

Reply via email to