Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 May 2003 17:37:09 -0700 (PDT)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 31037 for review
Message-ID:  <200305130037.h4D0b9YR047376@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=31037

Change 31037 by jmallett@jmallett_dalek on 2003/05/12 17:36:28

	Use implicit-operand-is-destination (two-register) syntax
	for the atomic ops so that we can fit more on one line.
	
	Remember to not (and re-not to loop) the val we and with in
	clear.  This is significantly better than doing it before
	and after we loop, and thus fudging up the API here, but
	it would be a lot faster to avoid these nots, so probably
	that's a mess to be made once that matters.

Affected files ...

.. //depot/projects/mips/sys/mips/include/atomic.h#16 edit

Differences ...

==== //depot/projects/mips/sys/mips/include/atomic.h#16 (text+ko) ====

@@ -113,10 +113,10 @@
 	);								\
 }
 
-ATOMIC_OP(add,		"addu %[temp], %[temp], %[val]")
-ATOMIC_OP(clear,	"and %[temp], %[temp], %[val]")
-ATOMIC_OP(set,		"or %[temp], %[temp], %[val]")
-ATOMIC_OP(subtract,	"subu %[temp], %[temp], %[val]")
+ATOMIC_OP(add,		"addu %[temp], %[val]")
+ATOMIC_OP(clear,	"not %[val] ; and %[temp], %[val] ; not %[val]")
+ATOMIC_OP(set,		"or %[temp], %[val]")
+ATOMIC_OP(subtract,	"subu %[temp], %[val]")
 
 ATOMIC_ACQ_OP(int, add)
 ATOMIC_REL_OP(int, add)
@@ -201,10 +201,10 @@
 	);								\
 }
 
-ATOMIC_DOP(add,		"daddu %[temp], %[temp], %[val]")
-ATOMIC_DOP(clear,	"and %[temp], %[temp], %[val]")
-ATOMIC_DOP(set,		"or %[temp], %[temp], %[val]")
-ATOMIC_DOP(subtract,	"dsubu %[temp], %[temp], %[val]")
+ATOMIC_DOP(add,		"daddu %[temp], %[val]")
+ATOMIC_DOP(clear,	"not %[val] ; and %[temp], %[val] ; not %[val]")
+ATOMIC_DOP(set,		"or %[temp], %[val]")
+ATOMIC_DOP(subtract,	"dsubu %[temp], %[val]")
 
 ATOMIC_ACQ_OP(long, add)
 ATOMIC_REL_OP(long, add)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305130037.h4D0b9YR047376>