Commit 17577e48 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

runtime: use SETEQ instead of JZ for cas

Change-Id: Ibabbca3988d39bdce584924173a912d45f50f0dd
Reviewed-on: https://go-review.googlesource.com/2243Reviewed-by: default avatarDave Cheney <dave@cheney.net>
Reviewed-by: default avatarMinux Ma <minux@golang.org>
parent 8bbd8006
...@@ -439,12 +439,7 @@ TEXT runtime·cas(SB), NOSPLIT, $0-13 ...@@ -439,12 +439,7 @@ TEXT runtime·cas(SB), NOSPLIT, $0-13
MOVL new+8(FP), CX MOVL new+8(FP), CX
LOCK LOCK
CMPXCHGL CX, 0(BX) CMPXCHGL CX, 0(BX)
JZ 4(PC) SETEQ , ret+12(FP)
MOVL $0, AX
MOVB AX, ret+12(FP)
RET
MOVL $1, AX
MOVB AX, ret+12(FP)
RET RET
TEXT runtime·casuintptr(SB), NOSPLIT, $0-13 TEXT runtime·casuintptr(SB), NOSPLIT, $0-13
...@@ -475,13 +470,7 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-21 ...@@ -475,13 +470,7 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-21
MOVL new_hi+16(FP), CX MOVL new_hi+16(FP), CX
LOCK LOCK
CMPXCHG8B 0(BP) CMPXCHG8B 0(BP)
JNZ fail SETEQ , ret+20(FP)
MOVL $1, AX
MOVB AX, ret+20(FP)
RET
fail:
MOVL $0, AX
MOVB AX, ret+20(FP)
RET RET
// bool casp(void **p, void *old, void *new) // bool casp(void **p, void *old, void *new)
...@@ -497,12 +486,7 @@ TEXT runtime·casp1(SB), NOSPLIT, $0-13 ...@@ -497,12 +486,7 @@ TEXT runtime·casp1(SB), NOSPLIT, $0-13
MOVL new+8(FP), CX MOVL new+8(FP), CX
LOCK LOCK
CMPXCHGL CX, 0(BX) CMPXCHGL CX, 0(BX)
JZ 4(PC) SETEQ , ret+12(FP)
MOVL $0, AX
MOVB AX, ret+12(FP)
RET
MOVL $1, AX
MOVB AX, ret+12(FP)
RET RET
// uint32 xadd(uint32 volatile *val, int32 delta) // uint32 xadd(uint32 volatile *val, int32 delta)
......
...@@ -427,12 +427,7 @@ TEXT runtime·cas(SB), NOSPLIT, $0-17 ...@@ -427,12 +427,7 @@ TEXT runtime·cas(SB), NOSPLIT, $0-17
MOVL new+12(FP), CX MOVL new+12(FP), CX
LOCK LOCK
CMPXCHGL CX, 0(BX) CMPXCHGL CX, 0(BX)
JZ 4(PC) SETEQ , ret+16(FP)
MOVL $0, AX
MOVB AX, ret+16(FP)
RET
MOVL $1, AX
MOVB AX, ret+16(FP)
RET RET
// bool runtime·cas64(uint64 *val, uint64 old, uint64 new) // bool runtime·cas64(uint64 *val, uint64 old, uint64 new)
...@@ -449,13 +444,7 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-25 ...@@ -449,13 +444,7 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-25
MOVQ new+16(FP), CX MOVQ new+16(FP), CX
LOCK LOCK
CMPXCHGQ CX, 0(BX) CMPXCHGQ CX, 0(BX)
JNZ fail SETEQ , ret+24(FP)
MOVL $1, AX
MOVB AX, ret+24(FP)
RET
fail:
MOVL $0, AX
MOVB AX, ret+24(FP)
RET RET
TEXT runtime·casuintptr(SB), NOSPLIT, $0-25 TEXT runtime·casuintptr(SB), NOSPLIT, $0-25
...@@ -483,12 +472,7 @@ TEXT runtime·casp1(SB), NOSPLIT, $0-25 ...@@ -483,12 +472,7 @@ TEXT runtime·casp1(SB), NOSPLIT, $0-25
MOVQ new+16(FP), CX MOVQ new+16(FP), CX
LOCK LOCK
CMPXCHGQ CX, 0(BX) CMPXCHGQ CX, 0(BX)
JZ 4(PC) SETEQ , ret+24(FP)
MOVL $0, AX
MOVB AX, ret+24(FP)
RET
MOVL $1, AX
MOVB AX, ret+24(FP)
RET RET
// uint32 xadd(uint32 volatile *val, int32 delta) // uint32 xadd(uint32 volatile *val, int32 delta)
......
...@@ -400,12 +400,7 @@ TEXT runtime·cas(SB), NOSPLIT, $0-17 ...@@ -400,12 +400,7 @@ TEXT runtime·cas(SB), NOSPLIT, $0-17
MOVL new+8(FP), CX MOVL new+8(FP), CX
LOCK LOCK
CMPXCHGL CX, 0(BX) CMPXCHGL CX, 0(BX)
JZ 4(PC) SETEQ , ret+16(FP)
MOVL $0, AX
MOVB AX, ret+16(FP)
RET
MOVL $1, AX
MOVB AX, ret+16(FP)
RET RET
TEXT runtime·casuintptr(SB), NOSPLIT, $0-17 TEXT runtime·casuintptr(SB), NOSPLIT, $0-17
...@@ -434,13 +429,7 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-25 ...@@ -434,13 +429,7 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-25
MOVQ new+16(FP), CX MOVQ new+16(FP), CX
LOCK LOCK
CMPXCHGQ CX, 0(BX) CMPXCHGQ CX, 0(BX)
JNZ fail SETEQ , ret+24(FP)
MOVL $1, AX
MOVB AX, ret+24(FP)
RET
fail:
MOVL $0, AX
MOVB AX, ret+24(FP)
RET RET
// bool casp(void **val, void *old, void *new) // bool casp(void **val, void *old, void *new)
...@@ -456,12 +445,7 @@ TEXT runtime·casp1(SB), NOSPLIT, $0-17 ...@@ -456,12 +445,7 @@ TEXT runtime·casp1(SB), NOSPLIT, $0-17
MOVL new+8(FP), CX MOVL new+8(FP), CX
LOCK LOCK
CMPXCHGL CX, 0(BX) CMPXCHGL CX, 0(BX)
JZ 4(PC) SETEQ , ret+16(FP)
MOVL $0, AX
MOVB AX, ret+16(FP)
RET
MOVL $1, AX
MOVB AX, ret+16(FP)
RET RET
// uint32 xadd(uint32 volatile *val, int32 delta) // uint32 xadd(uint32 volatile *val, int32 delta)
......
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