Skip to content

Commit 8c9ef9d

Browse files
committedJan 13, 2016
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 <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]>
1 parent 608ddc3 commit 8c9ef9d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/runtime/asm_386.s

+4-2
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,8 @@ TEXT strings·IndexByte(SB),NOSPLIT,$0-16
14391439
TEXT runtime·cmpbody(SB),NOSPLIT,$0-0
14401440
MOVL DX, BP
14411441
SUBL BX, DX // DX = blen-alen
1442-
CMOVLGT BX, BP // BP = min(alen, blen)
1442+
JLE 2(PC)
1443+
MOVL BX, BP // BP = min(alen, blen)
14431444
CMPL SI, DI
14441445
JEQ allsame
14451446
CMPL BP, $4
@@ -1558,7 +1559,8 @@ TEXT runtime·fastrand1(SB), NOSPLIT, $0-4
15581559
ADDL DX, DX
15591560
MOVL DX, BX
15601561
XORL $0x88888eef, DX
1561-
CMOVLMI BX, DX
1562+
JPL 2(PC)
1563+
MOVL BX, DX
15621564
MOVL DX, m_fastrand(AX)
15631565
MOVL DX, ret+0(FP)
15641566
RET

0 commit comments

Comments
 (0)
Please sign in to comment.