From 76db435e3cf86e0a6eb750d789bc15b64027a379 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 5 Jun 2014 07:57:23 +0200 Subject: [PATCH] pc64: dont trap _xinc()/_xdec() overflow/underflow, delete unused atomic functions --- sys/src/9/pc64/l.s | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/sys/src/9/pc64/l.s b/sys/src/9/pc64/l.s index c050940c2..3e2610db7 100644 --- a/sys/src/9/pc64/l.s +++ b/sys/src/9/pc64/l.s @@ -509,29 +509,15 @@ TEXT islo(SB), 1, $-4 /* * Synchronisation */ -TEXT ainc8(SB), 1, $-4 - XORL AX, AX - INCL AX - LOCK; XADDB AX, (RARG) -/* BOTCH INCL AX */ - RET - -TEXT _xinc(SB), 1, $-4 /* int _inc(long*); */ +TEXT _xinc(SB), 1, $-4 /* void _xinc(long*); */ MOVL $1, AX 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 -TEXT _xdec(SB), 1, $-4 /* int _dec(long*); */ +TEXT _xdec(SB), 1, $-4 /* long _xdec(long*); */ MOVL $-1, AX LOCK; XADDL AX, (RARG) - SUBL $1, AX /* underflow if -ve */ - JLT _trap + SUBL $1, AX RET TEXT tas(SB), 1, $-4 @@ -539,11 +525,6 @@ TEXT tas(SB), 1, $-4 XCHGL AX, (RARG) /* */ RET -TEXT fas64(SB), 1, $-4 - MOVQ p+8(FP), AX - LOCK; XCHGQ AX, (RARG) /* */ - RET - TEXT cmpswap486(SB), 1, $-4 TEXT cas(SB), 1, $-4 MOVL exp+8(FP), AX @@ -557,18 +538,6 @@ _cas32r0: DECL AX 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 */