runtime: don't use CMOV for 386
CMOVs were not introduced until P6. We need 386 to run on
Pentium MMX.
Fixes #13923
Change-Id: Iee9572cd83e64c3a1336bc1e6b300b048fbcc996
Reviewed-on: https://go-review.googlesource.com/18621
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/src/runtime/asm_386.s b/src/runtime/asm_386.s
index c5f0c51..4181859 100644
--- a/src/runtime/asm_386.s
+++ b/src/runtime/asm_386.s
@@ -1439,7 +1439,8 @@
TEXT runtime·cmpbody(SB),NOSPLIT,$0-0
MOVL DX, BP
SUBL BX, DX // DX = blen-alen
- CMOVLGT BX, BP // BP = min(alen, blen)
+ JLE 2(PC)
+ MOVL BX, BP // BP = min(alen, blen)
CMPL SI, DI
JEQ allsame
CMPL BP, $4
@@ -1558,7 +1559,8 @@
ADDL DX, DX
MOVL DX, BX
XORL $0x88888eef, DX
- CMOVLMI BX, DX
+ JPL 2(PC)
+ MOVL BX, DX
MOVL DX, m_fastrand(AX)
MOVL DX, ret+0(FP)
RET