Commit f70a19f0 authored by Russ Cox's avatar Russ Cox

runtime: fix 386 build after cas64 change

Missed this in CL 10909045.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/10803045
parent d7546479
......@@ -319,30 +319,26 @@ TEXT runtime·cas(SB), 7, $0
MOVL $1, AX
RET
// bool runtime·cas64(uint64 *val, uint64 *old, uint64 new)
// bool runtime·cas64(uint64 *val, uint64 old, uint64 new)
// Atomically:
// if(*val == *old){
// *val = new;
// return 1;
// } else {
// *old = *val
// return 0;
// }
TEXT runtime·cas64(SB), 7, $0
MOVL 4(SP), BP
MOVL 8(SP), SI
MOVL 0(SI), AX
MOVL 4(SI), DX
MOVL 12(SP), BX
MOVL 16(SP), CX
MOVL 8(SP), AX
MOVL 12(SP), DX
MOVL 16(SP), BX
MOVL 20(SP), CX
LOCK
CMPXCHG8B 0(BP)
JNZ cas64_fail
MOVL $1, AX
RET
cas64_fail:
MOVL AX, 0(SI)
MOVL DX, 4(SI)
MOVL $0, AX
RET
......
......@@ -38,7 +38,7 @@ runtime·xchg64(uint64 volatile* addr, uint64 v)
uint64 old;
do
old = addr;
old = *addr;
while(!runtime·cas64(addr, old, v));
return old;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment