qemu-devel
[Top][All Lists]
Advanced

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

RE: [PATCH v6 07/12] target/hexagon: prepare input for the idef-parser


From: Taylor Simpson
Subject: RE: [PATCH v6 07/12] target/hexagon: prepare input for the idef-parser
Date: Thu, 28 Oct 2021 15:44:00 +0000


> From: Anton Johansson <anjo@rev.ng> 
> Sent: Monday, October 18, 2021 6:23 AM
> To: Taylor Simpson <tsimpson@quicinc.com>; Alessandro Di Federico 
> <ale.qemu@rev.ng>; qemu-devel@nongnu.org
> Cc: Brian Cain <bcain@quicinc.com>; babush@rev.ng; nizzo@rev.ng; 
> richard.henderson@linaro.org; Alessandro Di Federico <ale@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

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