From 8c9ef9dd0a4667611a3afb710a319ba088a754ec Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Wed, 13 Jan 2016 13:09:46 -0800 Subject: [PATCH] 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 Run-TryBot: Brad Fitzpatrick --- src/runtime/asm_386.s | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime/asm_386.s b/src/runtime/asm_386.s index c5f0c51566..4181859724 100644 --- a/src/runtime/asm_386.s +++ b/src/runtime/asm_386.s @@ -1439,7 +1439,8 @@ TEXT strings·IndexByte(SB),NOSPLIT,$0-16 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 @@ TEXT runtime·fastrand1(SB), NOSPLIT, $0-4 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 -- 2.50.0