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] Tiny fix for #pragma omp atomic


On Thu, Sep 22, 2005 at 11:52:09AM -0400, Jakub Jelinek wrote:
> My reading of ISO C99, 6.2.5(21,18,11) suggests that they are considered
> scalar types.
> 21 says scalar types are arithmetic and pointer types
> 18 says arithmetic types are integer and floating types
> 11 says real floating and complex types are floating types

Well, it's non-aggregate.  But calling it scalar doesn't make sense.
Can anyone try icc or another omp implementation and see if it's
allowed either in fortran or C?

> I'd say it is just a sorry () candidate, external mutex doesn't help,
> as other threads might be reading the variable outside of #pragma omp
> atomic.

Hmm.  On x86, we can atomically store from the fpu.  But without
changes there's an outside chance that general registers could be
used.  On x86_64, there's cmpxchg16 that could be used.

But you're right that there's no way to atomically store a long
double on powerpc, and so the mutex only on writers doesn't help.


r~


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