Mercurial > hg > CbC > CbC_gcc
comparison libgomp/sections.c @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | a06113de4d67 |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
56:3c8a44c06a95 | 63:b7f97abdc517 |
---|---|
1 /* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc. | 1 /* Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
2 Contributed by Richard Henderson <rth@redhat.com>. | 2 Contributed by Richard Henderson <rth@redhat.com>. |
3 | 3 |
4 This file is part of the GNU OpenMP Library (libgomp). | 4 This file is part of the GNU OpenMP Library (libgomp). |
5 | 5 |
6 Libgomp is free software; you can redistribute it and/or modify it | 6 Libgomp is free software; you can redistribute it and/or modify it |
32 static inline void | 32 static inline void |
33 gomp_sections_init (struct gomp_work_share *ws, unsigned count) | 33 gomp_sections_init (struct gomp_work_share *ws, unsigned count) |
34 { | 34 { |
35 ws->sched = GFS_DYNAMIC; | 35 ws->sched = GFS_DYNAMIC; |
36 ws->chunk_size = 1; | 36 ws->chunk_size = 1; |
37 ws->end = count + 1; | 37 ws->end = count + 1L; |
38 ws->incr = 1; | 38 ws->incr = 1; |
39 ws->next = 1; | 39 ws->next = 1; |
40 #ifdef HAVE_SYNC_BUILTINS | |
41 /* Prepare things to make each iteration faster. */ | |
42 if (sizeof (long) > sizeof (unsigned)) | |
43 ws->mode = 1; | |
44 else | |
45 { | |
46 struct gomp_thread *thr = gomp_thread (); | |
47 struct gomp_team *team = thr->ts.team; | |
48 long nthreads = team ? team->nthreads : 1; | |
49 | |
50 ws->mode = ((nthreads | ws->end) | |
51 < 1UL << (sizeof (long) * __CHAR_BIT__ / 2 - 1)); | |
52 } | |
53 #else | |
54 ws->mode = 0; | |
55 #endif | |
40 } | 56 } |
41 | 57 |
42 /* This routine is called when first encountering a sections construct | 58 /* This routine is called when first encountering a sections construct |
43 that is not bound directly to a parallel construct. The first thread | 59 that is not bound directly to a parallel construct. The first thread |
44 that arrives will create the work-share construct; subsequent threads | 60 that arrives will create the work-share construct; subsequent threads |