+2019-08-29 Uroš Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386-features.c
+ (general_scalar_chain::compute_convert_gain):
+ Correct cost for double-word shifts.
+ (general_scalar_to_vector_candidate_p): Reject count operands
+ greater or equal to mode bitsize.
+
2019-08-29 Uroš Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (inline_secondary_memory_needed): Return true
|| GET_CODE (src) == ASHIFTRT
|| GET_CODE (src) == LSHIFTRT)
{
+ if (m == 2)
+ {
+ if (INTVAL (XEXP (src, 1)) >= 32)
+ igain += ix86_cost->add;
+ else
+ igain += ix86_cost->shift_const;
+ }
+
+ igain += ix86_cost->shift_const - ix86_cost->sse_op;
+
if (CONST_INT_P (XEXP (src, 0)))
igain -= vector_const_cost (XEXP (src, 0));
- igain += m * ix86_cost->shift_const - ix86_cost->sse_op;
- if (INTVAL (XEXP (src, 1)) >= 32)
- igain -= COSTS_N_INSNS (1);
}
else if (GET_CODE (src) == PLUS
|| GET_CODE (src) == MINUS
case ASHIFT:
case LSHIFTRT:
if (!CONST_INT_P (XEXP (src, 1))
- || !IN_RANGE (INTVAL (XEXP (src, 1)), 0, 63))
+ || !IN_RANGE (INTVAL (XEXP (src, 1)), 0, GET_MODE_BITSIZE (mode)-1))
return false;
break;