2016-12-02 Jakub Jelinek <jakub@redhat.com>
+ PR target/70322
+ * config/i386/i386.c (dimode_scalar_to_vector_candidate_p): Handle
+ NOT.
+ (dimode_scalar_chain::compute_convert_gain): Likewise.
+ (dimode_scalar_chain::convert_insn): Likewise.
+ * config/i386/i386.md (*one_cmpldi2_doubleword): New
+ define_insn_and_split.
+ (one_cmpl<mode>2): Use SWIM1248x iterator instead of SWIM.
+
PR target/78614
* rtl.c (copy_rtx): Don't clear used flag here.
(shallow_copy_rtx_stat): Clear used flag here unless code the rtx
return false;
break;
+ case NOT:
+ break;
+
case REG:
return true;
if ((GET_MODE (XEXP (src, 0)) != DImode
&& !CONST_INT_P (XEXP (src, 0)))
- || (GET_MODE (XEXP (src, 1)) != DImode
+ || (GET_CODE (src) != NOT
+ && GET_MODE (XEXP (src, 1)) != DImode
&& !CONST_INT_P (XEXP (src, 1))))
return false;
if (CONST_INT_P (XEXP (src, 1)))
gain -= vector_const_cost (XEXP (src, 1));
}
+ else if (GET_CODE (src) == NOT)
+ gain += ix86_cost->add - COSTS_N_INSNS (1);
else if (GET_CODE (src) == COMPARE)
{
/* Assume comparison cost is the same. */
PUT_MODE (src, V2DImode);
break;
+ case NOT:
+ src = XEXP (src, 0);
+ convert_op (&src, insn);
+ subreg = gen_reg_rtx (V2DImode);
+ emit_insn_before (gen_move_insn (subreg, CONSTM1_RTX (V2DImode)), insn);
+ src = gen_rtx_XOR (V2DImode, src, subreg);
+ break;
+
case MEM:
if (!REG_P (dst))
convert_op (&src, insn);
\f
;; One complement instructions
+(define_insn_and_split "*one_cmpldi2_doubleword"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
+ (not:DI (match_operand:DI 1 "nonimmediate_operand" "0")))]
+ "!TARGET_64BIT && TARGET_STV && TARGET_SSE2
+ && ix86_unary_operator_ok (NOT, DImode, operands)"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0)
+ (not:SI (match_dup 1)))
+ (set (match_dup 2)
+ (not:SI (match_dup 3)))]
+ "split_double_mode (DImode, &operands[0], 2, &operands[0], &operands[2]);")
+
(define_expand "one_cmpl<mode>2"
- [(set (match_operand:SWIM 0 "nonimmediate_operand")
- (not:SWIM (match_operand:SWIM 1 "nonimmediate_operand")))]
+ [(set (match_operand:SWIM1248x 0 "nonimmediate_operand")
+ (not:SWIM1248x (match_operand:SWIM1248x 1 "nonimmediate_operand")))]
""
"ix86_expand_unary_operator (NOT, <MODE>mode, operands); DONE;")
+2016-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70322
+ * gcc.target/i386/pr70322-1.c: New test.
+ * gcc.target/i386/pr70322-2.c: New test.
+ * gcc.target/i386/pr70322-3.c: New test.
+
2016-12-02 Andre Vieira <andre.simoesdiasvieira@arm.com>
Thomas Preud'homme <thomas.preudhomme@arm.com>
--- /dev/null
+/* PR target/70322 */
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2 -msse2 -mstv -mbmi" } */
+/* { dg-final { scan-assembler "pandn" } } */
+
+extern long long z;
+
+void
+foo (long long x, long long y)
+{
+ z = ~x & y;
+}
--- /dev/null
+/* PR target/70322 */
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2 -msse2 -mstv -mno-bmi" } */
+/* { dg-final { scan-assembler "pandn" { xfail *-*-* } } } */
+
+extern long long z;
+
+void
+foo (long long x, long long y)
+{
+ z = ~x & y;
+}
--- /dev/null
+/* PR target/70322 */
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2 -msse2 -mstv" } */
+/* { dg-final { scan-assembler "pxor" } } */
+/* { dg-final { scan-assembler "por" } } */
+
+extern long long z;
+
+void
+foo (long long x, long long y)
+{
+ z = ~x | y;
+}