On 11/20/23 11:26, Richard Sandiford wrote: >> + /* ?!? What is the point of this adjustment to DST_MASK? */ >> + if (code == PLUS || code == MINUS >> + || code == MULT || code == ASHIFT) >> + dst_mask >> + = dst_mask ? ((2ULL << floor_log2 (dst_mask)) - 1) : 0; > > Yeah, sympathise with the ?!? here :) Jeff Law: > Inherited. Like the other bit of magic I think I'll do a test with them > pulled out to see if I can make something undesirable trigger.
This represents the carry effect. Even if the destination only cares about some high order bits, you have to consider all lower order bits of the inputs. For ASHIFT, you could refine this in the case of a constant shift count.