2015-06-22 Nathan Sidwell <nathan@codesourcery.com>
* omp-low.c (expand_oacc_get_num_threads): Use OACC enum.
(expand_oacc_get_thread_num, make_predication_test): Likewise.
* builtins.c (expand_oacc_id): Use UINTVAL.
===================================================================
@@ -4994,8 +4994,8 @@ expand_oacc_get_num_threads (gimple_seq
tree decl = builtin_decl_explicit (BUILT_IN_GOACC_NID);
unsigned ix;
- for (ix = 0; (1 << ix) <= gwv_bits; ix++)
- if ((1 << ix) & gwv_bits)
+ for (ix = OACC_gang; ix != OACC_HWM; ix++)
+ if (OACC_LOOP_MASK(ix) & gwv_bits)
{
tree arg = build_int_cst (unsigned_type_node, ix);
tree count = create_tmp_var (unsigned_type_node);
@@ -5022,8 +5022,8 @@ expand_oacc_get_thread_num (gimple_seq *
unsigned ix;
/* Start at gang level, and examine relevant dimension indices. */
- for (ix = 0; (1 << ix) <= gwv_bits; ix++)
- if ((1 << ix) & gwv_bits)
+ for (ix = OACC_gang; ix != OACC_HWM; ix++)
+ if (OACC_LOOP_MASK (ix) & gwv_bits)
{
tree arg = build_int_cst (unsigned_type_node, ix);
@@ -10671,7 +10671,7 @@ make_predication_test (edge true_edge, b
unsigned ix;
for (ix = OACC_worker; ix <= OACC_vector; ix++)
- if (mask & (1 << ix))
+ if (OACC_LOOP_MASK (ix) & mask)
{
gimple call = gimple_build_call
(decl, 1, build_int_cst (unsigned_type_node, ix));
===================================================================
@@ -5971,8 +5971,7 @@ expand_oacc_id (enum built_in_function f
rtx arg;
arg = expand_normal (arg0);
- if (GET_CODE (arg) != CONST_INT
- || (unsigned HOST_WIDE_INT)INTVAL (arg) >= OACC_HWM)
+ if (GET_CODE (arg) != CONST_INT || UINTVAL (arg) >= OACC_HWM)
{
error ("argument to %D must be constant in range 0 to %d",
get_callee_fndecl (exp), OACC_HWM - 1);