All of lore.kernel.org
 help / color / mirror / Atom feed
* MIPS atomic memory operations (A.K.A PR 33479).
@ 2007-09-19  0:12 David Daney
  2007-09-19  2:32 ` Daniel Jacobowitz
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: David Daney @ 2007-09-19  0:12 UTC (permalink / raw)
  To: Richard Sandiford, GCC Mailing List; +Cc: linux-mips

Richard,

There seems to be a small problem with the MIPS atomic memory operations 
patch I recently committed 
(http://gcc.gnu.org/ml/gcc-patches/2007-08/msg01290.html), in that on a 
dual CPU machine it does not quite work.

You can look at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33479#c3 for 
more information.

Here is the code in question (from mips.h):

#define MIPS_COMPARE_AND_SWAP(SUFFIX, OP)	\
   "%(%<%[sync\n"				\
   "1:\tll" SUFFIX "\t%0,%1\n"			\
   "\tbne\t%0,%2,2f\n"				\
   "\t" OP "\t%@,%3\n"				\
   "\tsc" SUFFIX "\t%@,%1\n"			\
   "\tbeq\t%@,%.,1b\n"				\
   "\tnop\n"					\
   "2:%]%>%)"



I guess my basic question is:  Should MIPS_COMPARE_AND_SWAP have a 
'sync' after the 'sc'?  I would have thought that 'sc' made the write 
visible to all CPUs, but on the SB1 it appears not to be the case.

If we do need to add another 'sync' should it go in the delay slot of 
the branch?  I would say yes because we would expect the branch to 
rarely taken.

Any feedback from linux-mips people is also solicited.

Thanks,
David Daney

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-09-19 18:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-19  0:12 MIPS atomic memory operations (A.K.A PR 33479) David Daney
2007-09-19  2:32 ` Daniel Jacobowitz
2007-09-19  8:45 ` Thiemo Seufer
2007-09-19 16:58 ` Ralf Baechle
2007-09-19 17:07   ` Maciej W. Rozycki
2007-09-19 17:26     ` David Daney
2007-09-19 17:46       ` Maciej W. Rozycki
2007-09-19 17:49         ` David Daney
2007-09-19 18:12           ` Thiemo Seufer
2007-09-19 18:28             ` Ralf Baechle
2007-09-19 17:47       ` David Daney
2007-09-19 18:08         ` Maciej W. Rozycki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.