Commit b3bdf019 by Jakub Jelinek Committed by Jakub Jelinek

c-pragma.c (c_pp_lookup_pragma): Handle PRAGMA_CILK_SIMD.

	* c-pragma.c (c_pp_lookup_pragma): Handle PRAGMA_CILK_SIMD.
	(init_pragma): Call cpp_register_deferred_pragma for PRAGMA_CILK_SIMD
	even when flag_preprocess_only.

	* c-c++-common/cilk-plus/PS/vectorlength-2.c: New test.
	* c-c++-common/cilk-plus/PS/vectorlength-3.c: New test.

From-SVN: r208268
parent 79c7fda6
2014-03-03 Jakub Jelinek <jakub@redhat.com>
* c-pragma.c (c_pp_lookup_pragma): Handle PRAGMA_CILK_SIMD.
(init_pragma): Call cpp_register_deferred_pragma for PRAGMA_CILK_SIMD
even when flag_preprocess_only.
2014-02-26 Jason Merrill <jason@redhat.com> 2014-02-26 Jason Merrill <jason@redhat.com>
PR c++/59231 PR c++/59231
......
...@@ -1221,6 +1221,13 @@ c_pp_lookup_pragma (unsigned int id, const char **space, const char **name) ...@@ -1221,6 +1221,13 @@ c_pp_lookup_pragma (unsigned int id, const char **space, const char **name)
return; return;
} }
if (id == PRAGMA_CILK_SIMD)
{
*space = NULL;
*name = "simd";
return;
}
if (id >= PRAGMA_FIRST_EXTERNAL if (id >= PRAGMA_FIRST_EXTERNAL
&& (id < PRAGMA_FIRST_EXTERNAL + registered_pp_pragmas.length ())) && (id < PRAGMA_FIRST_EXTERNAL + registered_pp_pragmas.length ()))
{ {
...@@ -1384,7 +1391,7 @@ init_pragma (void) ...@@ -1384,7 +1391,7 @@ init_pragma (void)
omp_pragmas_simd[i].id, true, true); omp_pragmas_simd[i].id, true, true);
} }
if (flag_cilkplus && !flag_preprocess_only) if (flag_cilkplus)
cpp_register_deferred_pragma (parse_in, NULL, "simd", PRAGMA_CILK_SIMD, cpp_register_deferred_pragma (parse_in, NULL, "simd", PRAGMA_CILK_SIMD,
true, false); true, false);
......
2014-03-03 Jakub Jelinek <jakub@redhat.com>
* c-c++-common/cilk-plus/PS/vectorlength-2.c: New test.
* c-c++-common/cilk-plus/PS/vectorlength-3.c: New test.
2014-03-02 Jan Hubicka <hubicka@ucw.cz> 2014-03-02 Jan Hubicka <hubicka@ucw.cz>
PR ipa/60150 PR ipa/60150
......
/* { dg-do compile } */
/* { dg-options "-O2 -fcilkplus" } */
#define vl(n) vectorlength(2*n)
void
foo (int *a, int *b, int *c)
{
int i;
#pragma simd vl(4)
for (i = 0; i < 64; i++)
a[i] = b[i] * c[i];
}
/* { dg-do compile } */
/* { dg-options "-O2 -fcilkplus -save-temps" } */
#define vl(n) vectorlength(2*n)
void
foo (int *a, int *b, int *c)
{
int i;
#pragma simd vl(4)
for (i = 0; i < 64; i++)
a[i] = b[i] * c[i];
}
/* { dg-final { cleanup-saved-temps } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment