#651, for 64 bit type on x86 __iso_volatile_store64#694
#651, for 64 bit type on x86 __iso_volatile_store64#694BillyONeal merged 50 commits intomicrosoft:masterfrom
Conversation
without complier barrier for memory_order_relaxed, with complier barrier for memory_order_release, other orders unchanged.
|
Here's reduced ICE: DevCom-986061 |
|
Related: I don't get the use of I mean. if |
|
Totally possible |
ARM and ARM64 have always had the full complement of |
|
There is a difference in codegen, __ldrexd produces ldrexd, and __iso_volatile_load64 produces ldrd. This program: Compiled with VS 2019 Preview: Produces following asm: |
|
Regarding everything except |
|
We talked about this in our weekly meeting, and we believe that waiting for the ICE to be fixed is preferable over using inline assembly (which has been problematic in the past). I'll mark this PR as blocked. |
cbezault
left a comment
There was a problem hiding this comment.
This looks good to me.
My suggestions are weak suggestions, not strong ones, feel free to resolve if you don't think it's worth the effort.
stl/inc/atomic
Outdated
|
|
||
| #if defined(_M_ARM) || defined(_M_ARM64) | ||
| _Memory_barrier(); | ||
| #else // ^^^ ARM32/ARM64 hardware / x86/x64 hardware vvv |
There was a problem hiding this comment.
Is the implementation for x86/x64 likely safe on any other hypothetical architecture? Assumptions about architecture is what has gotten us into this mess of mediocre ARM support we're in now.
There was a problem hiding this comment.
Good question. It is both unsafe, and possibly inefficient where it is safe.
There was a problem hiding this comment.
So I've addressed this place.
But there are some places like here:
Lines 489 to 495 in 4deaf6c
I think any of the implementations looks working (apart from _Memory_barrier() undefined on x86/x64, but it can be defined). But it still does not make sense to use the wrong implementation for each platform for performance reasons. Should compilation be broken for unknown platform here as well?
There was a problem hiding this comment.
I'm more okay with it in this case. _InterlockedExchange16 will likely be defined on future architectures. Also you're not directly touching this so no reason to hold up the PR on that.
Co-authored-by: Curtis J Bezault <curtbezault@gmail.com>
Co-authored-by: Curtis J Bezault <curtbezault@gmail.com>
…into atomic_x86_store # Conflicts: # stl/inc/atomic
stl/inc/atomic
Outdated
|
|
||
| #if defined(_M_ARM) || defined(_M_ARM64) | ||
| _Memory_barrier(); | ||
| #else // ^^^ ARM32/ARM64 hardware / x86/x64 hardware vvv |
There was a problem hiding this comment.
I'm more okay with it in this case. _InterlockedExchange16 will likely be defined on future architectures. Also you're not directly touching this so no reason to hold up the PR on that.
Co-authored-by: Curtis J Bezault <curtbezault@gmail.com>
StephanTLavavej
left a comment
There was a problem hiding this comment.
(@BillyONeal has offered to commit/test these minor changes to the GitHub and MSVC PRs; thanks Billy!)
|
@AlexGuteniev Thank you for your contribution! |
This was added by microsoft#694 after microsoft#653.
#651, for 64 bit type on x86 __iso_volatile_store64
without complier barrier for memory_order_relaxed,
with complier barrier for memory_order_release,
other orders unchanged.