[committed] Change sse4_1 to sse4.1 and sse4_2 to sse4.2

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[committed] Change sse4_1 to sse4.1 and sse4_2 to sse4.2

Jakub Jelinek
Hi!

With the support for string literals, there is no need to obfuscate
sse4.2 to sse4_2; not doing it makes it easier to describe, because
the option is -msse4.2, not -msse4_2.

Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk.

2019-11-14  Jakub Jelinek  <[hidden email]>

        * 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.

--- gcc/config/i386/i386-options.c.jj 2019-11-13 10:54:56.641875411 +0100
+++ gcc/config/i386/i386-options.c 2019-11-13 15:24:19.266370999 +0100
@@ -316,19 +316,13 @@ ix86_omp_device_kind_arch_isa (enum omp_
   HOST_WIDE_INT mask = i ? ix86_isa_flags2 : ix86_isa_flags;
   for (size_t n = 0; n < nopts; n++)
     {
-      const char *option = opts[n].option + 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.  */
+      /* Handle sse4 as an alias to sse4.2.  */
       if (opts[n].mask == OPTION_MASK_ISA_SSE4_2)
  {
-  option = "sse4_2";
   if (strcmp (name, "sse4") == 0)
     return (mask & opts[n].mask) != 0 ? 1 : -1;
  }
-      else if (opts[n].mask == OPTION_MASK_ISA_SSE4_1)
- option = "sse4_1";
-      if (strcmp (name, option) == 0)
+      if (strcmp (name, opts[n].option + 2) == 0)
  return (mask & opts[n].mask) != 0 ? 1 : -1;
     }
  }
--- gcc/config/i386/t-omp-device.jj 2019-11-02 00:33:48.374547757 +0100
+++ gcc/config/i386/t-omp-device 2019-11-13 15:22:01.173467114 +0100
@@ -3,4 +3,4 @@ omp-device-properties-i386: $(srcdir)/co
  echo arch: x86 x86_64 i386 i486 i586 i686 ia32 >> $@
  echo isa: sse4 `sed -n '/^static struct ix86_target_opts isa2\?_opts\[\] =/,/^};/p' \
   $(srcdir)/config/i386/i386-options.c | \
-  sed -n 's/",.*$$//;s/\./_/;s/^  { "-m//p'` >> $@
+  sed -n 's/",.*$$//;s/^  { "-m//p'` >> $@
--- gcc/testsuite/c-c++-common/gomp/declare-variant-11.c.jj 2019-11-13 12:56:27.328081745 +0100
+++ gcc/testsuite/c-c++-common/gomp/declare-variant-11.c 2019-11-13 15:25:40.045144859 +0100
@@ -14,7 +14,7 @@ void f05 (void);
 void f06 (void);
 void f07 (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)})
 void f09 (void);
 void f10 (void);

        Jakub