From: Austin Clements Date: Fri, 9 Jun 2017 19:46:08 +0000 (-0400) Subject: runtime: YIELD in procyield on ARM X-Git-Tag: go1.9beta1~50 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bdc64183c83fbf5c595d1b18eb9addff1bf2be8d;p=gostls13.git runtime: YIELD in procyield on ARM ARM currently does not use a hardware yield instruction in the spin loop in procyield because the YIELD instruction was only added in ARMv6K. However, it appears earlier ARM chips will interpret the YIELD encoding as an effective NOP (specifically an MSR instruction that ultimately has no effect on the CPSR register). Hence, use YIELD in procyield on ARM since it should be, at worst, harmless. Fixes #16663. Change-Id: Id1787ac48862b785b92c28f1ac84cb4908d2173d Reviewed-on: https://go-review.googlesource.com/45250 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- diff --git a/src/runtime/asm_arm.s b/src/runtime/asm_arm.s index 803cf8d4bf..87f9378247 100644 --- a/src/runtime/asm_arm.s +++ b/src/runtime/asm_arm.s @@ -941,6 +941,7 @@ TEXT runtime·procyield(SB),NOSPLIT,$-4 MOVW cycles+0(FP), R1 MOVW $0, R0 yieldloop: + WORD $0xe320f001 // YIELD (NOP pre-ARMv6K) CMP R0, R1 B.NE 2(PC) RET