diff options
Diffstat (limited to 'gcc/c-family/c-common.h')
-rw-r--r-- | gcc/c-family/c-common.h | 155 |
1 files changed, 152 insertions, 3 deletions
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index 722ba6e5c15..1f8333e94a0 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -1034,17 +1034,166 @@ extern void pp_dir_change (cpp_reader *, const char *); extern bool check_missing_format_attribute (tree, tree); /* In c-omp.c */ +#if HOST_BITS_PER_WIDE_INT >= 64 +typedef unsigned HOST_WIDE_INT omp_clause_mask; +# define OMP_CLAUSE_MASK_1 ((omp_clause_mask) 1) +#else +struct omp_clause_mask +{ + inline omp_clause_mask (); + inline omp_clause_mask (unsigned HOST_WIDE_INT l); + inline omp_clause_mask (unsigned HOST_WIDE_INT l, + unsigned HOST_WIDE_INT h); + inline omp_clause_mask &operator &= (omp_clause_mask); + inline omp_clause_mask &operator |= (omp_clause_mask); + inline omp_clause_mask operator ~ () const; + inline omp_clause_mask operator & (omp_clause_mask) const; + inline omp_clause_mask operator | (omp_clause_mask) const; + inline omp_clause_mask operator >> (int); + inline omp_clause_mask operator << (int); + inline bool operator == (omp_clause_mask) const; + inline bool operator != (omp_clause_mask) const; + unsigned HOST_WIDE_INT low, high; +}; + +inline +omp_clause_mask::omp_clause_mask () +{ +} + +inline +omp_clause_mask::omp_clause_mask (unsigned HOST_WIDE_INT l) +: low (l), high (0) +{ +} + +inline +omp_clause_mask::omp_clause_mask (unsigned HOST_WIDE_INT l, + unsigned HOST_WIDE_INT h) +: low (l), high (h) +{ +} + +inline omp_clause_mask & +omp_clause_mask::operator &= (omp_clause_mask b) +{ + low &= b.low; + high &= b.high; + return *this; +} + +inline omp_clause_mask & +omp_clause_mask::operator |= (omp_clause_mask b) +{ + low |= b.low; + high |= b.high; + return *this; +} + +inline omp_clause_mask +omp_clause_mask::operator ~ () const +{ + omp_clause_mask ret (~low, ~high); + return ret; +} + +inline omp_clause_mask +omp_clause_mask::operator | (omp_clause_mask b) const +{ + omp_clause_mask ret (low | b.low, high | b.high); + return ret; +} + +inline omp_clause_mask +omp_clause_mask::operator & (omp_clause_mask b) const +{ + omp_clause_mask ret (low & b.low, high & b.high); + return ret; +} + +inline omp_clause_mask +omp_clause_mask::operator << (int amount) +{ + omp_clause_mask ret; + if (amount >= HOST_BITS_PER_WIDE_INT) + { + ret.low = 0; + ret.high = low << (amount - HOST_BITS_PER_WIDE_INT); + } + else if (amount == 0) + ret = *this; + else + { + ret.low = low << amount; + ret.high = (low >> (HOST_BITS_PER_WIDE_INT - amount)) + | (high << amount); + } + return ret; +} + +inline omp_clause_mask +omp_clause_mask::operator >> (int amount) +{ + omp_clause_mask ret; + if (amount >= HOST_BITS_PER_WIDE_INT) + { + ret.low = high >> (amount - HOST_BITS_PER_WIDE_INT); + ret.high = 0; + } + else if (amount == 0) + ret = *this; + else + { + ret.low = (high << (HOST_BITS_PER_WIDE_INT - amount)) + | (low >> amount); + ret.high = high >> amount; + } + return ret; +} + +inline bool +omp_clause_mask::operator == (omp_clause_mask b) const +{ + return low == b.low && high == b.high; +} + +inline bool +omp_clause_mask::operator != (omp_clause_mask b) const +{ + return low != b.low || high != b.high; +} + +# define OMP_CLAUSE_MASK_1 omp_clause_mask (1) +#endif + +enum c_omp_clause_split +{ + C_OMP_CLAUSE_SPLIT_TARGET = 0, + C_OMP_CLAUSE_SPLIT_TEAMS, + C_OMP_CLAUSE_SPLIT_DISTRIBUTE, + C_OMP_CLAUSE_SPLIT_PARALLEL, + C_OMP_CLAUSE_SPLIT_FOR, + C_OMP_CLAUSE_SPLIT_SIMD, + C_OMP_CLAUSE_SPLIT_COUNT, + C_OMP_CLAUSE_SPLIT_SECTIONS = C_OMP_CLAUSE_SPLIT_FOR +}; + extern tree c_finish_omp_master (location_t, tree); +extern tree c_finish_omp_taskgroup (location_t, tree); extern tree c_finish_omp_critical (location_t, tree, tree); extern tree c_finish_omp_ordered (location_t, tree); extern void c_finish_omp_barrier (location_t); extern tree c_finish_omp_atomic (location_t, enum tree_code, enum tree_code, - tree, tree, tree, tree, tree); + tree, tree, tree, tree, tree, bool, bool); extern void c_finish_omp_flush (location_t); extern void c_finish_omp_taskwait (location_t); extern void c_finish_omp_taskyield (location_t); -extern tree c_finish_omp_for (location_t, tree, tree, tree, tree, tree, tree); -extern void c_split_parallel_clauses (location_t, tree, tree *, tree *); +extern tree c_finish_omp_for (location_t, enum tree_code, tree, tree, tree, + tree, tree, tree); +extern void c_omp_split_clauses (location_t, enum tree_code, omp_clause_mask, + tree, tree *); +extern tree c_omp_declare_simd_clauses_to_numbers (tree, tree); +extern void c_omp_declare_simd_clauses_to_decls (tree, tree); extern enum omp_clause_default_kind c_omp_predetermined_sharing (tree); /* Not in c-omp.c; provided by the front end. */ |