@@ -449,7 +449,8 @@ scalar_chain::add_insn (bitmap candidates, unsigned int insn_uid,
return true;
for (ref = DF_INSN_UID_USES (insn_uid); ref; ref = DF_REF_NEXT_LOC (ref))
- if (!DF_REF_REG_MEM_P (ref))
+ if (DF_REF_TYPE (ref) == DF_REF_REG_USE
+ && !SUBREG_P (DF_REF_REG (ref)))
if (!analyze_register_chain (candidates, ref, disallowed))
return false;
@@ -1621,7 +1622,8 @@ timode_scalar_chain::convert_op (rtx *op, rtx_insn *insn)
else
{
gcc_assert (SUBREG_P (*op));
- gcc_assert (GET_MODE (*op) == vmode);
+ if (GET_MODE (*op) != V1TImode)
+ *op = gen_lowpart (V1TImode, *op);
}
}
@@ -1912,12 +1914,8 @@ convertible_comparison_p (rtx_insn *insn, enum machine_mode mode)
rtx op2 = XEXP (src, 1);
/* *cmp<dwi>_doubleword. */
- if ((CONST_SCALAR_INT_P (op1)
- || ((REG_P (op1) || MEM_P (op1))
- && GET_MODE (op1) == mode))
- && (CONST_SCALAR_INT_P (op2)
- || ((REG_P (op2) || MEM_P (op2))
- && GET_MODE (op2) == mode)))
+ if (general_operand (op1, mode)
+ && general_operand (op2, mode))
return true;
/* *testti_doubleword. */
@@ -2244,8 +2242,9 @@ timode_remove_non_convertible_regs (bitmap candidates)
DF_REF_REGNO (ref));
FOR_EACH_INSN_USE (ref, insn)
- if (!DF_REF_REG_MEM_P (ref)
- && GET_MODE (DF_REF_REG (ref)) == TImode)
+ if (DF_REF_TYPE (ref) == DF_REF_REG_USE
+ && GET_MODE (DF_REF_REG (ref)) == TImode
+ && !SUBREG_P (DF_REF_REG (ref)))
timode_check_non_convertible_regs (candidates, regs,
DF_REF_REGNO (ref));
}
new file mode 100644
@@ -0,0 +1,22 @@
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O2 -msse4.1" } */
+
+typedef long long __m128i __attribute__ ((__vector_size__ (16)));
+
+int foo (__m128i x, __m128i y)
+{
+ return (__int128)x == (__int128)y;
+}
+
+int bar (__m128i x, __m128i y)
+{
+ return (__int128)(x^y) == 0;
+}
+
+int baz (__m128i x, __m128i y)
+{
+ return (__int128)(x==y) == ~0;
+}
+
+/* { dg-final { scan-assembler-times "ptest\[ \\t\]+%" 3 } } */
+/* { dg-final { scan-assembler-not "%\[er\]sp" } } */