* CPU architectures and features.
*/
enum cpu_arch_features {
- arch_generic = 0x00000001, /**< no specific architecture */
+ arch_generic32 = 0x00000001, /**< no specific architecture */
arch_i386 = 0x00000002, /**< i386 architecture */
arch_i486 = 0x00000004, /**< i486 architecture */
* CPU's.
*/
enum cpu_support {
- cpu_generic = arch_generic,
+ cpu_generic = arch_generic32,
/* intel CPU's */
cpu_i386 = arch_i386,
};
typedef struct insn_const {
- int add_cost; /**< cost of an add instruction */
- int lea_cost; /**< cost of a lea instruction */
- int const_shf_cost; /**< cost of a constant shift instruction */
- int cost_mul_start; /**< starting cost of a multiply instruction */
- int cost_mul_bit; /**< cost of multiply for every set bit */
- unsigned function_alignment; /**< logarithm for alignment of function labels */
- unsigned label_alignment; /**< logarithm for alignment of loops labels */
+ int add_cost; /**< cost of an add instruction */
+ int lea_cost; /**< cost of a lea instruction */
+ int const_shf_cost; /**< cost of a constant shift instruction */
+ int cost_mul_start; /**< starting cost of a multiply instruction */
+ int cost_mul_bit; /**< cost of multiply for every set bit */
+ unsigned function_alignment; /**< logarithm for alignment of function labels */
+ unsigned label_alignment; /**< logarithm for alignment of loops labels */
+ unsigned label_alignment_max_skip; /**< maximum skip for alignment of loops labels */
} insn_const;
/* costs for the i386 */
1, /* cost of multiply for every set bit */
2, /* logarithm for alignment of function labels */
2, /* logarithm for alignment of loops labels */
+ 3, /* maximum skip for alignment of loops labels */
};
/* costs for the i486 */
1, /* cost of multiply for every set bit */
4, /* logarithm for alignment of function labels */
4, /* logarithm for alignment of loops labels */
+ 15, /* maximum skip for alignment of loops labels */
};
/* costs for the Pentium */
0, /* cost of multiply for every set bit */
4, /* logarithm for alignment of function labels */
4, /* logarithm for alignment of loops labels */
+ 7, /* maximum skip for alignment of loops labels */
};
/* costs for the Pentium Pro */
0, /* cost of multiply for every set bit */
4, /* logarithm for alignment of function labels */
4, /* logarithm for alignment of loops labels */
+ 10, /* maximum skip for alignment of loops labels */
};
/* costs for the K6 */
0, /* cost of multiply for every set bit */
5, /* logarithm for alignment of function labels */
5, /* logarithm for alignment of loops labels */
+ 7, /* maximum skip for alignment of loops labels */
};
/* costs for the Geode */
0, /* cost of multiply for every set bit */
0, /* logarithm for alignment of function labels */
0, /* logarithm for alignment of loops labels */
+ 0, /* maximum skip for alignment of loops labels */
};
/* costs for the Athlon */
0, /* cost of multiply for every set bit */
4, /* logarithm for alignment of function labels */
4, /* logarithm for alignment of loops labels */
+ 7, /* maximum skip for alignment of loops labels */
};
/* costs for the Opteron/K8/K10 */
0, /* cost of multiply for every set bit */
4, /* logarithm for alignment of function labels */
4, /* logarithm for alignment of loops labels */
+ 7, /* maximum skip for alignment of loops labels */
};
/* costs for the K10 */
0, /* cost of multiply for every set bit */
5, /* logarithm for alignment of function labels */
5, /* logarithm for alignment of loops labels */
+ 7, /* maximum skip for alignment of loops labels */
};
/* costs for the Pentium 4 */
0, /* cost of multiply for every set bit */
4, /* logarithm for alignment of function labels */
4, /* logarithm for alignment of loops labels */
+ 7, /* maximum skip for alignment of loops labels */
};
/* costs for the Nocona and Core */
0, /* cost of multiply for every set bit */
4, /* logarithm for alignment of function labels */
4, /* logarithm for alignment of loops labels */
+ 7, /* maximum skip for alignment of loops labels */
};
/* costs for the Core2 */
0, /* cost of multiply for every set bit */
4, /* logarithm for alignment of function labels */
4, /* logarithm for alignment of loops labels */
+ 10, /* maximum skip for alignment of loops labels */
};
-/* costs for the generic */
-static const insn_const generic_cost = {
+/* costs for the generic32 */
+static const insn_const generic32_cost = {
1, /* cost of an add instruction */
2, /* cost of a lea instruction */
1, /* cost of a constant shift instruction */
0, /* cost of multiply for every set bit */
4, /* logarithm for alignment of function labels */
4, /* logarithm for alignment of loops labels */
+ 7, /* maximum skip for alignment of loops labels */
};
-static const insn_const *arch_costs = &generic_cost;
+static const insn_const *arch_costs = &generic32_cost;
static void set_arch_costs(void)
{
case arch_k10:
arch_costs = &k10_cost;
break;
- case 0:
+ case arch_generic32:
default:
- arch_costs = &generic_cost;
+ arch_costs = &generic32_cost;
}
}
ia32_cg_config.use_fucomi = FLAGS(arch, arch_feature_p6_insn);
ia32_cg_config.use_cmov = FLAGS(arch, arch_feature_p6_insn);
ia32_cg_config.use_modeD_moves = FLAGS(opt_arch, arch_athlon_plus | arch_geode | arch_ppro |
- arch_netburst | arch_nocona | arch_core2 | arch_generic);
+ arch_netburst | arch_nocona | arch_core2 | arch_generic32);
ia32_cg_config.use_add_esp_4 = FLAGS(opt_arch, arch_geode | arch_athlon_plus |
- arch_netburst | arch_nocona | arch_core2 | arch_generic);
+ arch_netburst | arch_nocona | arch_core2 | arch_generic32);
ia32_cg_config.use_add_esp_8 = FLAGS(opt_arch, arch_geode | arch_athlon_plus |
arch_i386 | arch_i486 | arch_ppro | arch_netburst |
- arch_nocona | arch_core2 | arch_generic);
+ arch_nocona | arch_core2 | arch_generic32);
ia32_cg_config.use_sub_esp_4 = FLAGS(opt_arch, arch_athlon_plus | arch_ppro |
- arch_netburst | arch_nocona | arch_core2 | arch_generic);
+ arch_netburst | arch_nocona | arch_core2 | arch_generic32);
ia32_cg_config.use_sub_esp_8 = FLAGS(opt_arch, arch_athlon_plus | arch_i386 | arch_i486 |
- arch_ppro | arch_netburst | arch_nocona | arch_core2 | arch_generic);
+ arch_ppro | arch_netburst | arch_nocona | arch_core2 | arch_generic32);
ia32_cg_config.use_imul_mem_imm32 = !FLAGS(opt_arch, arch_k8 | arch_k10);
ia32_cg_config.use_mov_0 = FLAGS(opt_arch, arch_k6);
- ia32_cg_config.use_pad_return = FLAGS(opt_arch, arch_athlon_plus | cpu_core2 | arch_generic);
+ ia32_cg_config.use_pad_return = FLAGS(opt_arch, arch_athlon_plus | cpu_core2 | arch_generic32);
ia32_cg_config.optimize_cc = opt_cc;
ia32_cg_config.use_unsafe_floatconv = opt_unsafe_floatconv;
- ia32_cg_config.function_alignment = arch_costs->function_alignment;
- ia32_cg_config.label_alignment = arch_costs->label_alignment;
+ ia32_cg_config.function_alignment = arch_costs->function_alignment;
+ ia32_cg_config.label_alignment = arch_costs->label_alignment;
+ ia32_cg_config.label_alignment_max_skip = arch_costs->label_alignment_max_skip;
if (opt_arch & (arch_i386 | arch_i486)) {
ia32_cg_config.label_alignment_factor = 0;