diff options
Diffstat (limited to 'gcc/config/i386/i386.c')
-rw-r--r-- | gcc/config/i386/i386.c | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 02b5103138a..3263656eef3 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1025,8 +1025,8 @@ const struct processor_costs bdver1_cost = { 4, /* vec_align_load_cost. */ 4, /* vec_unalign_load_cost. */ 4, /* vec_store_cost. */ - 2, /* cond_taken_branch_cost. */ - 1, /* cond_not_taken_branch_cost. */ + 4, /* cond_taken_branch_cost. */ + 2, /* cond_not_taken_branch_cost. */ }; /* BDVER2 has optimized REP instruction for medium sized blocks, but for @@ -1121,8 +1121,8 @@ const struct processor_costs bdver2_cost = { 4, /* vec_align_load_cost. */ 4, /* vec_unalign_load_cost. */ 4, /* vec_store_cost. */ - 2, /* cond_taken_branch_cost. */ - 1, /* cond_not_taken_branch_cost. */ + 4, /* cond_taken_branch_cost. */ + 2, /* cond_not_taken_branch_cost. */ }; @@ -1208,8 +1208,8 @@ struct processor_costs bdver3_cost = { 4, /* vec_align_load_cost. */ 4, /* vec_unalign_load_cost. */ 4, /* vec_store_cost. */ - 2, /* cond_taken_branch_cost. */ - 1, /* cond_not_taken_branch_cost. */ + 4, /* cond_taken_branch_cost. */ + 2, /* cond_not_taken_branch_cost. */ }; /* BDVER4 has optimized REP instruction for medium sized blocks, but for @@ -1294,8 +1294,8 @@ struct processor_costs bdver4_cost = { 4, /* vec_align_load_cost. */ 4, /* vec_unalign_load_cost. */ 4, /* vec_store_cost. */ - 2, /* cond_taken_branch_cost. */ - 1, /* cond_not_taken_branch_cost. */ + 4, /* cond_taken_branch_cost. */ + 2, /* cond_not_taken_branch_cost. */ }; /* BTVER1 has optimized REP instruction for medium sized blocks, but for @@ -4168,6 +4168,7 @@ ix86_option_override_internal (bool main_args_p, if (opts->x_flag_prefetch_loop_arrays < 0 && HAVE_prefetch && (opts->x_optimize >= 3 || opts->x_flag_profile_use) + && !opts->x_optimize_size && TARGET_SOFTWARE_PREFETCHING_BENEFICIAL) opts->x_flag_prefetch_loop_arrays = 1; @@ -5649,7 +5650,7 @@ ix86_handle_cconv_attribute (tree *node, tree name, else if (is_attribute_p ("thiscall", name)) { if (TREE_CODE (*node) != METHOD_TYPE && pedantic) - warning (OPT_Wattributes, "%qE attribute is used for none class-method", + warning (OPT_Wattributes, "%qE attribute is used for non-class method", name); if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (*node))) { @@ -35863,6 +35864,15 @@ safe_vector_operand (rtx x, machine_mode mode) return x; } +/* Fixup modeless constants to fit required mode. */ +static rtx +fixup_modeless_constant (rtx x, machine_mode mode) +{ + if (GET_MODE (x) == VOIDmode) + x = convert_to_mode (mode, x, 1); + return x; +} + /* Subroutine of ix86_expand_builtin to take care of binop insns. */ static rtx @@ -37509,6 +37519,8 @@ ix86_expand_args_builtin (const struct builtin_description *d, if (memory_operand (op, mode)) num_memory++; + op = fixup_modeless_constant (op, mode); + if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) { if (optimize || !match || num_memory > 1) @@ -37661,7 +37673,7 @@ ix86_expand_sse_comi_round (const struct builtin_description *d, } if (INTVAL (op2) < 0 || INTVAL (op2) >= 32) { - error ("incorect comparison mode"); + error ("incorrect comparison mode"); return const0_rtx; } @@ -37882,6 +37894,8 @@ ix86_expand_round_builtin (const struct builtin_description *d, if (VECTOR_MODE_P (mode)) op = safe_vector_operand (op, mode); + op = fixup_modeless_constant (op, mode); + if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) { if (optimize || !match) @@ -38289,6 +38303,8 @@ ix86_expand_special_args_builtin (const struct builtin_description *d, if (VECTOR_MODE_P (mode)) op = safe_vector_operand (op, mode); + op = fixup_modeless_constant (op, mode); + if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) op = copy_to_mode_reg (mode, op); else @@ -39852,6 +39868,9 @@ addcarryx: op1 = copy_to_mode_reg (Pmode, op1); if (!insn_data[icode].operand[3].predicate (op2, mode2)) op2 = copy_to_mode_reg (mode2, op2); + + op3 = fixup_modeless_constant (op3, mode3); + if (GET_MODE (op3) == mode3 || GET_MODE (op3) == VOIDmode) { if (!insn_data[icode].operand[4].predicate (op3, mode3)) @@ -39995,6 +40014,8 @@ addcarryx: if (!insn_data[icode].operand[0].predicate (op0, Pmode)) op0 = copy_to_mode_reg (Pmode, op0); + op1 = fixup_modeless_constant (op1, mode1); + if (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode) { if (!insn_data[icode].operand[1].predicate (op1, mode1)) @@ -40041,6 +40062,8 @@ addcarryx: mode3 = insn_data[icode].operand[3].mode; mode4 = insn_data[icode].operand[4].mode; + op0 = fixup_modeless_constant (op0, mode0); + if (GET_MODE (op0) == mode0 || (GET_MODE (op0) == VOIDmode && op0 != constm1_rtx)) { |