i386: Prefer remote atomic insn for atomic_fetch{add, and, or, xor}
authorkonglin1 <lingling.kong@intel.com>
Mon, 7 Nov 2022 03:21:14 +0000 (11:21 +0800)
committerkonglin1 <lingling.kong@intel.com>
Mon, 7 Nov 2022 03:21:17 +0000 (11:21 +0800)
commit48fa4131e419942efc9dd762694fdc7e819de392
tree328441a50522b2b07e240a1c34eae4c44057347e
parent4cf1c61995f5221edf51bb7f34e4b000fe558753
i386: Prefer remote atomic insn for atomic_fetch{add, and, or, xor}

Add flag -mprefer-remote-atomic to control whether to generate raoint
insn for atomic operations.

gcc/ChangeLog:

* config/i386/i386.opt:Add -mprefer-remote-atomic.
* config/i386/sync.md (atomic_<plus_logic><mode>):
New define_expand.
(atomic_add<mode>): Rename to below one.
(atomic_add<mode>_1): To this.
(atomic_<logic><mode>): Ditto.
(atomic_<logic><mode>_1): Ditto.
* doc/invoke.texi: Add -mprefer-remote-atomic.

gcc/testsuite/ChangeLog:

* gcc.target/i386/raoint-atomic-fetch.c: New test.
gcc/config/i386/i386.opt
gcc/config/i386/sync.md
gcc/doc/invoke.texi
gcc/testsuite/gcc.target/i386/raoint-atomic-fetch.c [new file with mode: 0644]