public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* instruction sync -- need to preserve order
@ 2001-12-06 14:05 Rayson Ho
  2001-12-06 15:04 ` Geoff Keating
  0 siblings, 1 reply; 2+ messages in thread
From: Rayson Ho @ 2001-12-06 14:05 UTC (permalink / raw)
  To: gcc

Hi,

How can I make sure that gcc does not schedule instructions across a
memory barrier?? I am porting a threads library from AIX to PPC Linux,
and on AIX, the compiler has a build-in instruction that allows me to
do that.

Thanks,
Rayson



__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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

* Re: instruction sync -- need to preserve order
  2001-12-06 14:05 instruction sync -- need to preserve order Rayson Ho
@ 2001-12-06 15:04 ` Geoff Keating
  0 siblings, 0 replies; 2+ messages in thread
From: Geoff Keating @ 2001-12-06 15:04 UTC (permalink / raw)
  To: Rayson Ho; +Cc: gcc

Rayson Ho <raysonlogin@yahoo.com> writes:

> Hi,
> 
> How can I make sure that gcc does not schedule instructions across a
> memory barrier?? I am porting a threads library from AIX to PPC Linux,
> and on AIX, the compiler has a build-in instruction that allows me to
> do that.

What you really want to do is specify to GCC that the memory barrier
affects memory, like this (assuming the barrier you're using is the
"sync" instruction):

  asm ("sync" : : : "memory");

Instructions that don't affect memory will still be scheduled across
it, but memory will be consistent.

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>

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

end of thread, other threads:[~2001-12-06 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-06 14:05 instruction sync -- need to preserve order Rayson Ho
2001-12-06 15:04 ` Geoff Keating

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).