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 ...@@ -319,30 +319,26 @@ TEXT runtime·cas(SB), 7, $0
MOVL $1, AX MOVL $1, AX
RET RET
// bool runtime·cas64(uint64 *val, uint64 *old, uint64 new) // bool runtime·cas64(uint64 *val, uint64 old, uint64 new)
// Atomically: // Atomically:
// if(*val == *old){ // if(*val == *old){
// *val = new; // *val = new;
// return 1; // return 1;
// } else { // } else {
// *old = *val
// return 0; // return 0;
// } // }
TEXT runtime·cas64(SB), 7, $0 TEXT runtime·cas64(SB), 7, $0
MOVL 4(SP), BP MOVL 4(SP), BP
MOVL 8(SP), SI MOVL 8(SP), AX
MOVL 0(SI), AX MOVL 12(SP), DX
MOVL 4(SI), DX MOVL 16(SP), BX
MOVL 12(SP), BX MOVL 20(SP), CX
MOVL 16(SP), CX
LOCK LOCK
CMPXCHG8B 0(BP) CMPXCHG8B 0(BP)
JNZ cas64_fail JNZ cas64_fail
MOVL $1, AX MOVL $1, AX
RET RET
cas64_fail: cas64_fail:
MOVL AX, 0(SI)
MOVL DX, 4(SI)
MOVL $0, AX MOVL $0, AX
RET RET
......
...@@ -38,7 +38,7 @@ runtime·xchg64(uint64 volatile* addr, uint64 v) ...@@ -38,7 +38,7 @@ runtime·xchg64(uint64 volatile* addr, uint64 v)
uint64 old; uint64 old;
do do
old = addr; old = *addr;
while(!runtime·cas64(addr, old, v)); while(!runtime·cas64(addr, old, v));
return old; 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