On 08/03/2012 10:40 AM, Richard Henderson wrote:
On 2012-08-03 01:51, Uros Bizjak wrote:
The same reasoning goes for dynamic negation: for neg %eax,%eax value
0x80000000 stays the same, but we have changed (x)sub to an (x)add in
the code stream.
So?  Did you think the xadd will trap?


Is there a good reason we can't do this in the generic code in optabs.c::expand_atomic_fetch_op()?

so if there is no ADD or SUB pattern, and the reverse does exist, we just negate the operand and use the opposite pattern...

we already use the reverse code for 'fixup' code if for instance fetch_after exists and fetch_before doesn't. Seems like a pretty trivial extension.

Andrew

Reply via email to