[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: |
Anton Johansson |
Subject: |
Re: [PATCH v6 07/12] target/hexagon: prepare input for the idef-parser |
Date: |
Mon, 18 Oct 2021 11:23:10 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
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.
--
Anton Johansson,
rev.ng Srls.
- Re: [PATCH v6 07/12] target/hexagon: prepare input for the idef-parser,
Anton Johansson <=