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: [gomp] Use __sync_* builtins for reduction


On Tue, Oct 11, 2005 at 11:47:40AM -0700, Richard Henderson wrote:
> On Tue, Oct 11, 2005 at 01:12:55PM -0400, Jakub Jelinek wrote:
> > 	* gimplify.c (omp_atomic_operation_p): New function.
> > 	(gimplify_omp_atomic): Use it.
> 
> I'd prefer you passed the operator and mode, and did the whole
> lookup.  This method will always use mutexes on i386, even if
> the reduction is PLUS on SImode, which is available as atomics.

Or omp-low.c could just special case a single reduction clause
and use GOMP_critical_* for 2+ reduction clauses.  Then gimplify.c
would need no changes, omp-low.c would just gimplify OMP_ATOMIC.
What do you think?

Also, perhaps it would be better to use GOMP_atomic_* rather
than GOMP_critical_* and let GOMP_atomic_start spin a few dozen/hundred
times before sleeping, as generally GOMP_atomic_* should surround
very short critical sections.

	Jakub


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