File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
stdlib/public/Synchronization/Mutex Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ var _tries: Int {
1717 100
1818}
1919
20+ #if arch(arm)
21+
2022// The following are acceptable operands to the aarch64 hint intrinsic from
2123// 'llvm-project/llvm/lib/Target/ARM/ARMInstrInfo.td':
2224//
@@ -28,9 +30,27 @@ var _tries: Int {
2830// `sevl` = 5
2931//
3032// There are others, but for the sake of spin loops, we only care about 'wfe'.
33+ @_extern ( c, " llvm.arm.hint " )
34+ func _hint( _: UInt32 )
35+
36+ #else
37+
38+ // The following are acceptable operands to the aarch64 hint intrinsic from
39+ // 'llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td':
40+ //
41+ // `nop` = 0
42+ // `yield` = 1
43+ // `wfe` = 2
44+ // `wfi` = 3
45+ // `sev` = 4
46+ // `sevl` = 5
47+ //
48+ // There are others, but for the sake of spin loops, we only care about 'wfe'.
3149@_extern( c, " llvm. aarch64 . hint" )
3250func _hint( _: UInt32 )
3351
52+ #endif
53+
3454@inline( __always)
3555func _wfe( ) {
3656 _hint ( 2 )
You can’t perform that action at this time.
0 commit comments