Hi!

On Tue, Dec 17, 2013 at 05:23:43PM +0000, Iyer, Balaji V wrote:
> +/* Returns name of the next clause in Cilk Plus SIMD-enabled function's
> +   attribute.
> +   If the clause is not recognized PRAGMA_OMP_CLAUSE_NONE is returned and
> +   the token is not consumed.  Otherwise appropriate pragma_omp_clause is
> +   returned and the token is consumed.  */
> +
> +static pragma_omp_clause
> +c_parser_cilk_simd_fn_clause_name (c_parser *parser)
> +{
> +  pragma_omp_clause result = PRAGMA_OMP_CLAUSE_NONE;
> +
> +  if (c_parser_next_token_is_not (parser, CPP_NAME))
> +    return result;
> +  
> +  const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value);
> +  if (!strcmp (p, "vectorlength"))
> +    result = PRAGMA_CILK_CLAUSE_VECTORLENGTH;
> +  else if (!strcmp (p, "uniform"))
> +    result = PRAGMA_CILK_CLAUSE_UNIFORM;
> +  else if (!strcmp (p, "linear"))
> +    result = PRAGMA_CILK_CLAUSE_LINEAR;
> +  else if (!strcmp (p, "mask"))
> +    result = PRAGMA_CILK_CLAUSE_MASK;
> +  else if (!strcmp (p, "nomask"))
> +    result = PRAGMA_CILK_CLAUSE_UNMASK;
> +
> +  if (result != PRAGMA_OMP_CLAUSE_NONE)
> +    c_parser_consume_token (parser);
> +  return result;
> +}

No, this isn't what I meant.  I meant that you add the 3 new clause names
to c_parser_omp_clause_name (and use PRAGMA_CILK_* for those).

> +      if (token->type == CPP_NAME
> +       && TREE_CODE (token->value) == IDENTIFIER_NODE)       
> +     if (!strcmp (IDENTIFIER_POINTER (token->value), "vectorlength"))
> +       {
> +         if (!c_parser_cilk_clause_vectorlength (parser, NULL, true))
> +           {
> +             c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL);
> +             return;
> +           }
> +         else
> +           continue;
> +       }

Why do you need this at all?  I'd expect you just remove this whole if and
the c_parser_cilk_clause_vectorlength function, and instead just parse
vectorlength normally when you see PRAGMA_CILK_CLAUSE_VECTORLENGTH.

> +       sorry ("using parameters for %<linear%> step is not supported "
> +              "in this release");

... is not supported yet".

> -      c_kind = c_parser_omp_clause_name (parser);
> + 
> +      if (mask == CILK_SIMD_FN_CLAUSE_MASK)
> +     c_kind = c_parser_cilk_simd_fn_clause_name (parser);
> +      else
> +     c_kind = c_parser_omp_clause_name (parser);

Please revert this.

> @@ -10933,7 +11088,8 @@
>         c_name = "aligned";
>         break;
>       case PRAGMA_OMP_CLAUSE_LINEAR:
> -       clauses = c_parser_omp_clause_linear (parser, clauses);
> +       clauses = c_parser_omp_clause_linear
> +         (parser, clauses, mask == CILK_SIMD_FN_CLAUSE_MASK);

Please test for some particular bit in the mask, not == on the masks.

        Jakub

Reply via email to