Skip to content

Commit

Permalink
runtime: don't use CMOV for 386
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
randall77 committed Jan 13, 2016
1 parent 608ddc3 commit 8c9ef9d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/runtime/asm_386.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8c9ef9d

Please sign in to comment.