PERFORCE change 31037 for review

Juli Mallett jmallett at FreeBSD.org
Mon May 12 17:37:12 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=31037

Change 31037 by jmallett at 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)


More information about the p4-projects mailing list