parsecpu.awk (all_cores): Remove duplicates.
authorTamar Christina <tamar.christina@arm.com>
Tue, 25 Jul 2017 13:25:36 +0000 (13:25 +0000)
committerTamar Christina <tnfchris@gcc.gnu.org>
Tue, 25 Jul 2017 13:25:36 +0000 (13:25 +0000)
2017-07-25  Tamar Christina  <tamar.christina@arm.com>

* config/arm/parsecpu.awk (all_cores): Remove duplicates.

From-SVN: r250519

gcc/ChangeLog
gcc/config/arm/parsecpu.awk

index 4597d3b2f572b71d28f32be0c645ec490bad8e98..c55e67a72e8e2bbdfeb41aa9ac780608f2af307d 100644 (file)
@@ -1,3 +1,7 @@
+2017-07-25  Tamar Christina  <tamar.christina@arm.com>
+
+       * config/arm/parsecpu.awk (all_cores): Remove duplicates.
+
 2017-07-25  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/81455
index 9d01e2cf992c9643534a7621e59e78041f8a1f9f..070d193b338ace0deb9aeb53a51796bfd633ade8 100644 (file)
@@ -223,10 +223,39 @@ function gen_comm_data () {
            if (arch_opt_remove[feats[1],feats[m]] == "true") {
                fatal("cannot remove features from architecture specs")
            }
-           print "        " arch_opt_isa[feats[1],feats[m]] ","
+           # The isa_features array that is being initialized here has a length
+           # of max isa_bit_num, which is the last entry in the enum.
+           # Logically this means that the number of features is implicitly
+           # never more than the number of feature bits we have.  This is only
+           # true if we don't emit duplicates here.  So keep track of which
+           # options we have already emitted so we don't emit them twice.
+           nopts = split (arch_opt_isa[feats[1],feats[m]], opts, ",")
+           for (i = 1; i <= nopts; i++) {
+               if (! (opts[i] in seen)) {
+                 print "        " opts[i] ","
+                 seen[opts[i]]
+               }
+           }
+       }
+       if (cpus[n] in cpu_fpu) {
+           nopts = split (fpu_isa[cpu_fpu[cpus[n]]], opts, ",")
+           for (i = 1; i <= nopts; i++) {
+               if (! (opts[i] in seen)) {
+                 print "        " opts[i] ","
+                 seen[opts[i]]
+               }
+           }
+       }
+       if (cpus[n] in cpu_isa) {
+           nopts = split (cpu_isa[cpus[n]], opts, ",")
+           for (i = 1; i <= nopts; i++) {
+               if (! (opts[i] in seen)) {
+                 print "        " opts[i] ","
+                 seen[opts[i]]
+               }
+           }
        }
-       if (cpus[n] in cpu_fpu) print "        " fpu_isa[cpu_fpu[cpus[n]]] ","
-       if (cpus[n] in cpu_isa) print "        " cpu_isa[cpus[n]] ","
+       delete seen
        print "        isa_nobit"
        print "      }"
        print "    },"