Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 May 2003 21:56:08 -0700 (PDT)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 30906 for review
Message-ID:  <200305100456.h4A4u8OQ029995@repoman.freebsd.org>

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

Change 30906 by jmallett@jmallett_dalek on 2003/05/09 21:55:24

	Mark temp variables as outputs so it doesn't look like we
	are getting values from them, and doing something wrong
	with them uninitialised.  The asm doesn't make any use of
	existing values in them.
	
	XXX, need to find a way to just get *A* temporary register
	in the inline assembler.  Maybe just mark $8 as clobbered
	and use it?

Affected files ...

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

Differences ...

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

@@ -107,8 +107,8 @@
 	asmop "\n\t"							\
 	"sc	%[temp], %[p]\n\t"					\
 	"beqz	%[temp], 1b\n\t"					\
-	: [val] "=&r"(val), [p] "+m"(*p)				\
-	: [temp] "r"(temp)						\
+	: [val] "=&r"(val), [temp] "=&r"(temp), [p] "+m"(*p)		\
+	: 								\
 	: "memory"							\
 	);								\
 }
@@ -146,8 +146,8 @@
 	"sc	%[temp], %[p]\n\t"
 	"beqz	%[temp], 1b\n\t"
 	"2:\n\t"
-	: [res] "=&r"(res), [p] "+m"(*p)
-	: [old] "r"(old), [val] "r"(val), [temp] "r"(temp)
+	: [res] "=&r"(res), [temp] "=&r"(temp), [p] "+m"(*p)
+	: [old] "r"(old), [val] "r"(val)
 	: "memory"
 	);
 
@@ -169,8 +169,8 @@
 	"move	%[temp], $0\n\t"
 	"sc	%[temp], %[p]\n\t"
 	"beqz	%[temp], 1b\n\t"
-	: [res] "=&r"(res), [p] "+m"(*p)
-	: [temp] "r"(temp)
+	: [res] "=&r"(res), [temp] "=&r"(temp), [p] "+m"(*p)
+	:
 	: "memory"
 	);
 
@@ -195,8 +195,8 @@
 	asmop "\n\t"							\
 	"scd	%[temp], %[p]\n\t"					\
 	"beqz	%[temp], 1b\n\t"					\
-	: [val] "=&r"(val), [p] "+m"(*p)				\
-	: [temp] "r"(temp)						\
+	: [val] "=&r"(val), [temp] "=&r"(temp), [p] "+m"(*p)		\
+	: 								\
 	: "memory"							\
 	);								\
 }
@@ -234,8 +234,8 @@
 	"scd	%[temp], %[p]\n\t"
 	"beqz	%[temp], 1b\n\t"
 	"2:\n\t"
-	: [res] "=&r"(res), [p] "+m"(*p)
-	: [old] "r"(old), [val] "r"(val), [temp] "r"(temp)
+	: [res] "=&r"(res), [temp] "=&r"(temp), [p] "+m"(*p)
+	: [old] "r"(old), [val] "r"(val)
 	: "memory"
 	);
 
@@ -257,8 +257,8 @@
 	"move	%[temp], $0\n\t"
 	"scd	%[temp], %[p]\n\t"
 	"beqz	%[temp], 1b\n\t"
-	: [res] "=&r"(res), [p] "+m"(*p)
-	: [temp] "r"(temp)
+	: [res] "=&r"(res), [temp] "=&r"(temp), [p] "+m"(*p)
+	:
 	: "memory"
 	);
 



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