Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6bb7a1a authored by Mark Salter's avatar Mark Salter Committed by Linus Torvalds
Browse files

mn10300: add cc clobbers to asm statements



gcc 4.2.1 for MN10300 is more agressive than the older gcc in
reordering/moving other insns between an insn that sets flags and an insn
that uses those flags.  This leads to trouble with asm statements which
are missing an explicit "cc" clobber.  This patch adds the explicit "cc"
clobber to asm statements which do indeed clobber the condition flags.

Signed-off-by: default avatarMark Salter <msalter@redhat.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b0641e86
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ static inline __attribute__((const))
unsigned long __ffs(unsigned long x)
{
	int bit;
	asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(x & -x));
	asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(x & -x) : "cc");
	return bit;
}

@@ -177,7 +177,7 @@ static inline __attribute__((const))
int __ilog2_u32(u32 n)
{
	int bit;
	asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(n));
	asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(n) : "cc");
	return bit;
}

+2 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ unsigned __muldiv64u(unsigned val, unsigned mult, unsigned div)
					 * MDR = MDR:val%div */
	    : "=r"(result)
	    : "0"(val), "ir"(mult), "r"(div)
	    : "cc"
	    );

	return result;
@@ -92,6 +93,7 @@ signed __muldiv64s(signed val, signed mult, signed div)
					 * MDR = MDR:val%div */
	    : "=r"(result)
	    : "0"(val), "ir"(mult), "r"(div)
	    : "cc"
	    );

	return result;
+1 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ do { \
		"	mov	%0,epsw		\n"			\
		: "=&d"(tmp)						\
		: "i"(~EPSW_IM), "r"(__mn10300_irq_enabled_epsw)	\
		: "cc"							\
		);							\
} while (0)

+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ do { \
		 "	mov %0,%1		\n"		\
		 : "=d"(w)					\
		 : "m"(MMUCTR), "i"(MMUCTR_IIV|MMUCTR_DIV)	\
		 : "memory"					\
		 : "cc", "memory"				\
		 );						\
} while (0)

+2 −2
Original line number Diff line number Diff line
@@ -316,7 +316,7 @@ do { \
			"	.previous\n"				\
			: "=a"(__from), "=a"(__to), "=r"(size), "=&r"(w)\
			: "0"(__from), "1"(__to), "2"(size)		\
			: "memory");					\
			: "cc", "memory");				\
	}								\
} while (0)

@@ -352,7 +352,7 @@ do { \
			"	.previous\n"				\
			: "=a"(__from), "=a"(__to), "=r"(size), "=&r"(w)\
			: "0"(__from), "1"(__to), "2"(size)		\
			: "memory");					\
			: "cc", "memory");				\
	}								\
} while (0)

Loading