shithub: mc

Download patch

ref: 62ea6ad22c399c646e396efe264c8314f14027a3
parent: 1c7f39ccba2038892671bcb708adf32bbf39c157
author: Ori Bernstein <ori@eigenstate.org'>
date: Wed Dec 30 11:10:55 EST 2015

Plan 9 asm swaps the order of CMP args.

	Reverse vs fwd copies makes a difference. oops.

--- a/lib/std/memops-impl+plan9-x64.s
+++ b/lib/std/memops-impl+plan9-x64.s
@@ -3,12 +3,12 @@
 std.memfill	: (dst : byte#, val : byte, len : std.size -> void)
 */
 TEXT std$memblit+0(SB),$0
-	CMPQ	DI,SI
+	CMPQ	SI,DI
 	JZ	.done
 	JG	.fwdcpy
 	MOVQ	SI,AX
 	SUBQ	DI,AX
-	CMPQ	AX,CX
+	CMPQ	CX,AX
 	JG	.revcpy
 .fwdcpy:
 	MOVQ	DX,CX