Files
Tom Stellard a093ef43dd Merging r288433:
------------------------------------------------------------------------
r288433 | oranevskyy | 2016-12-01 14:58:35 -0800 (Thu, 01 Dec 2016) | 24 lines

[ARM] Fix for 64-bit CAS expansion on ARM32 with -O0

Summary:
This patch fixes comparison of 64-bit atomic with its expected value in CMP_SWAP_64 expansion.

Currently, the low words are compared with CMP, while the high words are compared with SBC. SBC expects the carry flag to be set if CMP detects a difference. CMP might leave the carry unset for unequal arguments though if the first one is >= than the second. This might cause the comparison logic to detect false equality.

Example of the broken C++ code:
```
std::atomic<long long> at(2);

long long ll = 1;
std::atomic_compare_exchange_strong(&at, &ll, 3);
```
Even though the atomic `at` and the expected value `ll` are not equal and `atomic_compare_exchange_strong` returns `false`, `at` is changed to 3.

The patch replaces SBC with CMPEQ.

Reviewers: t.p.northover

Subscribers: aemerson, rengolin, llvm-commits, asl

Differential Revision: https://reviews.llvm.org/D27315

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@288847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 20:09:33 +00:00
..
2016-01-26 00:03:25 +00:00
2014-04-03 17:35:22 +00:00
2016-06-16 16:09:53 +00:00
2016-06-16 16:09:53 +00:00
2016-01-28 18:59:04 +00:00
2016-05-19 12:59:17 +00:00
2016-05-19 12:59:17 +00:00
2016-12-06 20:09:33 +00:00
2014-02-16 07:31:05 +00:00
2014-08-26 12:47:26 +00:00
2014-01-29 11:50:56 +00:00
2014-01-29 11:50:56 +00:00
2016-06-16 16:09:53 +00:00
2015-10-26 20:49:49 +00:00
2016-06-20 17:45:33 +00:00
2016-01-26 00:03:25 +00:00
2016-04-08 18:15:37 +00:00
2014-04-25 17:51:25 +00:00
2014-11-17 14:08:57 +00:00
2016-06-20 16:47:09 +00:00
2016-07-18 21:36:33 +00:00
2014-04-03 17:35:22 +00:00
2014-12-04 19:34:50 +00:00
2016-06-16 16:09:53 +00:00
2016-03-31 19:42:04 +00:00
2015-12-17 01:29:08 +00:00
2014-04-03 17:35:22 +00:00
2014-04-03 17:35:22 +00:00
2015-01-19 15:16:06 +00:00
2014-04-03 17:35:22 +00:00
2016-08-02 10:26:08 +00:00
2016-08-02 10:26:08 +00:00
2014-04-23 01:09:29 +00:00
2016-04-08 18:15:37 +00:00
2016-01-26 00:03:25 +00:00
2016-08-02 10:26:08 +00:00
2015-08-13 17:28:16 +00:00