Commit aa16689e by Jakub Jelinek Committed by Jakub Jelinek

i386-options.c (ix86_omp_device_kind_arch_isa): Don't change sse4.2 to sse4_2 and sse4.1 to sse4.1.

	* config/i386/i386-options.c (ix86_omp_device_kind_arch_isa): Don't
	change sse4.2 to sse4_2 and sse4.1 to sse4.1.
	* config/i386/t-omp-device (omp-device-properties-i386): Likewise.

	* c-c++-common/gomp/declare-variant-11.c: Add "sse4.2" and "sse4.1"
	test.

From-SVN: r278205
parent bedb7f04
2019-11-14 Jakub Jelinek <jakub@redhat.com> 2019-11-14 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386-options.c (ix86_omp_device_kind_arch_isa): Don't
change sse4.2 to sse4_2 and sse4.1 to sse4.1.
* config/i386/t-omp-device (omp-device-properties-i386): Likewise.
* omp-general.c (omp_context_name_list_prop): New function. * omp-general.c (omp_context_name_list_prop): New function.
(omp_context_selector_matches): Use it. Return 0 if it returns (omp_context_selector_matches): Use it. Return 0 if it returns
NULL. NULL.
...@@ -316,19 +316,13 @@ ix86_omp_device_kind_arch_isa (enum omp_device_kind_arch_isa trait, ...@@ -316,19 +316,13 @@ ix86_omp_device_kind_arch_isa (enum omp_device_kind_arch_isa trait,
HOST_WIDE_INT mask = i ? ix86_isa_flags2 : ix86_isa_flags; HOST_WIDE_INT mask = i ? ix86_isa_flags2 : ix86_isa_flags;
for (size_t n = 0; n < nopts; n++) for (size_t n = 0; n < nopts; n++)
{ {
const char *option = opts[n].option + 2; /* Handle sse4 as an alias to sse4.2. */
/* -msse4.2 and -msse4.1 options contain dot, which is not valid
in identifiers. Use underscore instead, and handle sse4
as an alias to sse4_2. */
if (opts[n].mask == OPTION_MASK_ISA_SSE4_2) if (opts[n].mask == OPTION_MASK_ISA_SSE4_2)
{ {
option = "sse4_2";
if (strcmp (name, "sse4") == 0) if (strcmp (name, "sse4") == 0)
return (mask & opts[n].mask) != 0 ? 1 : -1; return (mask & opts[n].mask) != 0 ? 1 : -1;
} }
else if (opts[n].mask == OPTION_MASK_ISA_SSE4_1) if (strcmp (name, opts[n].option + 2) == 0)
option = "sse4_1";
if (strcmp (name, option) == 0)
return (mask & opts[n].mask) != 0 ? 1 : -1; return (mask & opts[n].mask) != 0 ? 1 : -1;
} }
} }
......
...@@ -3,4 +3,4 @@ omp-device-properties-i386: $(srcdir)/config/i386/i386-options.c ...@@ -3,4 +3,4 @@ omp-device-properties-i386: $(srcdir)/config/i386/i386-options.c
echo arch: x86 x86_64 i386 i486 i586 i686 ia32 >> $@ echo arch: x86 x86_64 i386 i486 i586 i686 ia32 >> $@
echo isa: sse4 `sed -n '/^static struct ix86_target_opts isa2\?_opts\[\] =/,/^};/p' \ echo isa: sse4 `sed -n '/^static struct ix86_target_opts isa2\?_opts\[\] =/,/^};/p' \
$(srcdir)/config/i386/i386-options.c | \ $(srcdir)/config/i386/i386-options.c | \
sed -n 's/",.*$$//;s/\./_/;s/^ { "-m//p'` >> $@ sed -n 's/",.*$$//;s/^ { "-m//p'` >> $@
2019-11-14 Jakub Jelinek <jakub@redhat.com> 2019-11-14 Jakub Jelinek <jakub@redhat.com>
* c-c++-common/gomp/declare-variant-11.c: Add "sse4.2" and "sse4.1"
test.
* c-c++-common/gomp/declare-variant-2.c: Add test for non-integral * c-c++-common/gomp/declare-variant-2.c: Add test for non-integral
score and for negative score. score and for negative score.
* c-c++-common/gomp/declare-variant-3.c: Add test for zero score. * c-c++-common/gomp/declare-variant-3.c: Add test for zero score.
......
...@@ -14,7 +14,7 @@ void f05 (void); ...@@ -14,7 +14,7 @@ void f05 (void);
void f06 (void); void f06 (void);
void f07 (void); void f07 (void);
void f08 (void); void f08 (void);
#pragma omp declare variant (f07) match (device={isa(sse4,sse3,"avx")}) #pragma omp declare variant (f07) match (device={isa(sse4,"sse4.1","sse4.2",sse3,"avx")})
#pragma omp declare variant (f08) match (device={isa("avx",sse3)}) #pragma omp declare variant (f08) match (device={isa("avx",sse3)})
void f09 (void); void f09 (void);
void f10 (void); void f10 (void);
......
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