aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/i386/i386.cc')
-rw-r--r--gcc/config/i386/i386.cc48
1 files changed, 43 insertions, 5 deletions
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 587b2bd..75a9cb6 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -598,6 +598,20 @@ ix86_canonicalize_comparison (int *code, rtx *op0, rtx *op1,
}
}
+ /* SUB (a, b) underflows precisely when a < b. Convert
+ (compare (minus (a b)) a) to (compare (a b))
+ to match *sub<mode>_3 pattern. */
+ if (!op0_preserve_value
+ && (*code == GTU || *code == LEU)
+ && GET_CODE (*op0) == MINUS
+ && rtx_equal_p (XEXP (*op0, 0), *op1))
+ {
+ *op1 = XEXP (*op0, 1);
+ *op0 = XEXP (*op0, 0);
+ *code = (int) swap_condition ((enum rtx_code) *code);
+ return;
+ }
+
/* Swap operands of GTU comparison to canonicalize
addcarry/subborrow comparison. */
if (!op0_preserve_value
@@ -23753,9 +23767,15 @@ x86_print_call_or_nop (FILE *file, const char *target,
const char *label)
{
if (flag_nop_mcount || !strcmp (target, "nop"))
- /* 5 byte nop: nopl 0(%[re]ax,%[re]ax,1) */
- fprintf (file, "%s" ASM_BYTE "0x0f, 0x1f, 0x44, 0x00, 0x00\n",
- label);
+ {
+ if (TARGET_16BIT)
+ /* 3 byte no-op: lea 0(%si), %si */
+ fprintf (file, "%s" ASM_BYTE "0x8d, 0x74, 0x00\n", label);
+ else
+ /* 5 byte nop: nopl 0(%[re]ax,%[re]ax,1) */
+ fprintf (file, "%s" ASM_BYTE "0x0f, 0x1f, 0x44, 0x00, 0x00\n",
+ label);
+ }
else if (!TARGET_PECOFF && flag_pic)
{
gcc_assert (flag_plt);
@@ -25089,7 +25109,7 @@ i386_solaris_elf_named_section (const char *name, unsigned int flags,
return;
}
-#ifndef USE_GAS
+#if !HAVE_GNU_AS
if (HAVE_COMDAT_GROUP && flags & SECTION_LINKONCE)
{
solaris_elf_asm_comdat_section (name, flags, decl);
@@ -26377,7 +26397,20 @@ ix86_vector_costs::add_stmt_cost (int count, vect_cost_for_stmt kind,
(TREE_OPERAND (gimple_assign_rhs1 (def), 0))))))
{
if (fp)
- m_num_sse_needed[where]++;
+ {
+ /* Scalar FP values residing in x87 registers need to be
+ spilled and reloaded. */
+ auto mode2 = TYPE_MODE (TREE_TYPE (op));
+ if (IS_STACK_MODE (mode2))
+ {
+ int cost
+ = (ix86_cost->hard_register.fp_store[mode2 == SFmode
+ ? 0 : 1]
+ + ix86_cost->sse_load[sse_store_index (mode2)]);
+ stmt_cost += COSTS_N_INSNS (cost) / 2;
+ }
+ m_num_sse_needed[where]++;
+ }
else
{
m_num_gpr_needed[where]++;
@@ -26595,6 +26628,11 @@ ix86_vector_costs::finish_cost (const vector_costs *scalar_costs)
if (loop_vinfo
&& !LOOP_VINFO_EPILOGUE_P (loop_vinfo)
&& LOOP_VINFO_VECT_FACTOR (loop_vinfo).to_constant () > 2
+ /* Avoid a masked epilog if cascaded epilogues eventually get us
+ to one with VF 1 as that means no scalar epilog at all. */
+ && !((GET_MODE_SIZE (loop_vinfo->vector_mode)
+ / LOOP_VINFO_VECT_FACTOR (loop_vinfo).to_constant () == 16)
+ && ix86_tune_features[X86_TUNE_AVX512_TWO_EPILOGUES])
&& ix86_tune_features[X86_TUNE_AVX512_MASKED_EPILOGUES]
&& !OPTION_SET_P (param_vect_partial_vector_usage))
{