This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Fix full memory barrier on SPARC-V8


From: Eric Botcazou <ebotcazou@adacore.com>
Date: Mon, 27 Jun 2011 18:11:10 +0200

> 	* config/sparc/sync.md (*stbar): Delete.
> 	(*membar_v8): New insn to implement UNSPEC_MEMBAR in SPARC-V8.

Code which cares about memory ordering etc. really has to know
the kind of cpu it is running on.

This is why atomic and synchronization primitives are typically
restricted to shared libraries and similar, where the dynamic
linker can vet out what is the correct implementation on a
given piece of hardware.

V8 can only reorder stores, that's why it only has a 'stbar'
instruction.  I'm not so sure I agree with trying to paper over the
fact that someone has compiled code for v8 that's going to run on a v9
cpu.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]