attempt to make register allocation deterministic

This commit is contained in:
Michael McLoughlin
2018-12-13 00:34:44 -08:00
parent 93b53377ac
commit c70c642ddb
2 changed files with 9 additions and 9 deletions

View File

@@ -3,16 +3,16 @@
// func Sum(xs []uint64) uint64
TEXT ·Sum(SB),0,$0-32
MOVQ xs_base(FP), DX
MOVQ xs_len+8(FP), AX
XORQ CX, CX
MOVQ xs_base(FP), AX
MOVQ xs_len+8(FP), CX
XORQ DX, DX
loop:
CMPQ AX, $0x0
CMPQ CX, $0x0
JE done
ADDQ (DX), CX
ADDQ $0x8, DX
DECQ AX
ADDQ (AX), DX
ADDQ $0x8, AX
DECQ CX
JMP loop
done:
MOVQ CX, ret+24(FP)
MOVQ DX, ret+24(FP)
RET