Use yield, not wfe, for asm_volatile_pause on ARM and ARM64
authorScott Wolchok <swolchok@fb.com>
Sat, 27 Feb 2016 20:39:23 +0000 (12:39 -0800)
committerFacebook Github Bot 0 <facebook-github-bot-0-bot@fb.com>
Sat, 27 Feb 2016 20:50:31 +0000 (12:50 -0800)
commitadd5a7aeacacb050c4b0bad84aac1475fa2658c9
treeffac35c7e1200175e0ac29f245896a12ace6a73d
parenta7d7c07cadb5d5e9d55d5dd97b3e6069afe21245
Use yield, not wfe, for asm_volatile_pause on ARM and ARM64

Summary:Found this hunting down LockFreeRingBuffer iOS perf problems. `wfe` and `yield` are similar, but `yield` is the instruction meant for "hey, I'm doing a spinlock", whereas `wfe` tries to wait for certain processor events. See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/Cjafcggi.html

Conveniently, it's the same instruction on 32-bit and 64-bit ARM.

Reviewed By: yfeldblum

Differential Revision: D2986160

fb-gh-sync-id: 34671256112e605bf857f9db54a56cf6bb6f1ee2
shipit-source-id: 34671256112e605bf857f9db54a56cf6bb6f1ee2
folly/Portability.h