On 9/7/21 18:09, Taylor Simpson wrote:
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.+#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?
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.
