[PATCH, i386]: Implement atomic_fetch_sub

Andrew MacLeod amacleod@redhat.com
Thu Aug 23 16:00:00 GMT 2012


On 08/03/2012 02:52 PM, Andrew MacLeod wrote:
>
> I'll take a look at it next week unless someone gets to it first.
>
> Andrew

OK, so maybe I sort of forgot about implementing the generic 
transformation until now.

This patch bootstraps and passes all the testsuite cases.  Factored out 
a little code to make sure we only generate the add if there is a direct 
opcode for it.
Also implemented the reverse since it was trivial... if an atomic_add 
doesn't generate anything, it'll try an atomic_sub to see if thats possible.

If that all fails, then we continue to regress to a compare and swap loop.

bootstraps with no new regressions and verified to fix the PR with no 
side-effects

OK for mainline?

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr54087.diff
Type: text/x-patch
Size: 4651 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120823/2ee3d79d/attachment.bin>


More information about the Gcc-patches mailing list