pc64: dont trap _xinc()/_xdec() overflow/underflow, delete unused atomic functions

This commit is contained in:
cinap_lenrek 2014-06-05 07:57:23 +02:00
parent 863a459691
commit 76db435e3c

View file

@ -509,29 +509,15 @@ TEXT islo(SB), 1, $-4
/* /*
* Synchronisation * Synchronisation
*/ */
TEXT ainc8(SB), 1, $-4 TEXT _xinc(SB), 1, $-4 /* void _xinc(long*); */
XORL AX, AX
INCL AX
LOCK; XADDB AX, (RARG)
/* BOTCH INCL AX */
RET
TEXT _xinc(SB), 1, $-4 /* int _inc(long*); */
MOVL $1, AX MOVL $1, AX
LOCK; XADDL AX, (RARG) LOCK; XADDL AX, (RARG)
ADDL $1, AX /* overflow if -ve or 0 */
JGT _return
_trap:
XORQ BX, BX
MOVQ (BX), BX /* over under sideways down */
_return:
RET RET
TEXT _xdec(SB), 1, $-4 /* int _dec(long*); */ TEXT _xdec(SB), 1, $-4 /* long _xdec(long*); */
MOVL $-1, AX MOVL $-1, AX
LOCK; XADDL AX, (RARG) LOCK; XADDL AX, (RARG)
SUBL $1, AX /* underflow if -ve */ SUBL $1, AX
JLT _trap
RET RET
TEXT tas(SB), 1, $-4 TEXT tas(SB), 1, $-4
@ -539,11 +525,6 @@ TEXT tas(SB), 1, $-4
XCHGL AX, (RARG) /* */ XCHGL AX, (RARG) /* */
RET RET
TEXT fas64(SB), 1, $-4
MOVQ p+8(FP), AX
LOCK; XCHGQ AX, (RARG) /* */
RET
TEXT cmpswap486(SB), 1, $-4 TEXT cmpswap486(SB), 1, $-4
TEXT cas(SB), 1, $-4 TEXT cas(SB), 1, $-4
MOVL exp+8(FP), AX MOVL exp+8(FP), AX
@ -557,18 +538,6 @@ _cas32r0:
DECL AX DECL AX
RET RET
TEXT cas64(SB), 1, $-4
MOVQ exp+8(FP), AX
MOVQ new+16(FP), BX
LOCK; CMPXCHGQ BX, (RARG)
MOVL $1, AX /* use CMOVLEQ etc. here? */
JNZ _cas64r0
_cas64r1:
RET
_cas64r0:
DECL AX
RET
/* /*
* Label consists of a stack pointer and a programme counter * Label consists of a stack pointer and a programme counter
*/ */