diff options
Diffstat (limited to 'gcc/config/arm/parsecpu.awk')
-rw-r--r-- | gcc/config/arm/parsecpu.awk | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/gcc/config/arm/parsecpu.awk b/gcc/config/arm/parsecpu.awk index b6e50932ddc..070d193b338 100644 --- a/gcc/config/arm/parsecpu.awk +++ b/gcc/config/arm/parsecpu.awk @@ -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) print " " fpu_isa[cpu_fpu[cpus[n]]] "," - if (cpus[n] in cpu_isa) print " " cpu_isa[cpus[n]] "," + 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]] + } + } + } + delete seen print " isa_nobit" print " }" print " }," @@ -299,13 +328,19 @@ function gen_comm_data () { # arch, base_arch print " \"" arch_base[archs[n]] "\", BASE_ARCH_" \ arch_base[archs[n]] "," + # profile letter code, or zero if none. + if (archs[n] in arch_prof) { + print " '" arch_prof[archs[n]] "'," + } else { + print " 0," + } # tune_id print " TARGET_CPU_" cpu_cnames[arch_tune_for[archs[n]]] "," print " }," } print " {{NULL, NULL, {isa_nobit}}," - print " NULL, BASE_ARCH_0, TARGET_CPU_arm_none}" + print " NULL, BASE_ARCH_0, 0, TARGET_CPU_arm_none}" print "};\n" print "const arm_fpu_desc all_fpus[] =" @@ -477,6 +512,12 @@ BEGIN { parse_ok = 1 } +/^[ ]*profile / { + if (arch_name == "") fatal("\"profile\" statement outside of arch block") + arch_prof[arch_name] = $2 + parse_ok = 1 +} + /^end arch / { if (arch_name != $3) fatal("mimatched end arch") if (! arch_name in arch_tune_for) { |