aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/config/i386/i386.md18
-rw-r--r--gcc/testsuite/gcc.dg/pr105825.c13
2 files changed, 25 insertions, 6 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index eae1cb5..48a98e1 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -11934,9 +11934,12 @@
if ((INTVAL (operands[3]) & ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
!= ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
{
- rtx tem = gen_reg_rtx (SImode);
- emit_insn (gen_andsi3 (tem, operands[2], operands[3]));
- operands[2] = tem;
+ rtx xops[3];
+ xops[0] = gen_reg_rtx (GET_MODE (operands[2]));
+ xops[1] = operands[2];
+ xops[2] = operands[3];
+ ix86_expand_binary_operator (AND, GET_MODE (operands[2]), xops);
+ operands[2] = xops[0];
}
operands[2] = force_reg (GET_MODE (operands[2]), operands[2]);
@@ -12899,9 +12902,12 @@
if ((INTVAL (operands[3]) & ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
!= ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
{
- rtx tem = gen_reg_rtx (SImode);
- emit_insn (gen_andsi3 (tem, operands[2], operands[3]));
- operands[2] = tem;
+ rtx xops[3];
+ xops[0] = gen_reg_rtx (GET_MODE (operands[2]));
+ xops[1] = operands[2];
+ xops[2] = operands[3];
+ ix86_expand_binary_operator (AND, GET_MODE (operands[2]), xops);
+ operands[2] = xops[0];
}
operands[2] = force_reg (GET_MODE (operands[2]), operands[2]);
diff --git a/gcc/testsuite/gcc.dg/pr105825.c b/gcc/testsuite/gcc.dg/pr105825.c
new file mode 100644
index 0000000..d1eb829
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr105825.c
@@ -0,0 +1,13 @@
+/* PR target/105825 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-mavx" { target avx } } */
+
+__int128 j;
+int i;
+
+void
+foo (void)
+{
+ j <<= __builtin_parityll (i);
+}