From: Hongtao Liu Date: Wed, 11 Dec 2019 08:06:06 +0000 (+0000) Subject: Fix unrecognizable insn of pr92865. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8654147f153786a4339127228ac05ed550d0a2b;p=gcc.git Fix unrecognizable insn of pr92865. gcc/ PR target/92865 * config/i386/i386-expand.c (ix86_valid_mask_cmp_mode): Enable integer mask cmov when available even with TARGET_XOP. gcc/testsuite * gcc.target/i386/pr92865-1.c: New test. From-SVN: r279214 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fedf736bdab..6ea6db926e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-12-11 Hongtao Liu + + PR target/92865 + * config/i386/i386-expand.c (ix86_valid_mask_cmp_mode): Enable + integer mask cmov when available even with TARGET_XOP. + 2019-12-10 Jakub Jelinek PR tree-optimization/92891 diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c index ff3c24cc5b7..cbf4eb7b487 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c @@ -3428,7 +3428,7 @@ static bool ix86_valid_mask_cmp_mode (machine_mode mode) { /* XOP has its own vector conditional movement. */ - if (TARGET_XOP) + if (TARGET_XOP && !TARGET_AVX512F) return false; /* AVX512F is needed for mask operation. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 37de7de32f3..92eea2da375 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-12-11 Hongtao Liu + + * gcc.target/i386/pr92865-1.c: New test. + 2019-12-10 Jakub Jelinek PR tree-optimization/92891 diff --git a/gcc/testsuite/gcc.target/i386/pr92865-1.c b/gcc/testsuite/gcc.target/i386/pr92865-1.c new file mode 100644 index 00000000000..49b5778a067 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr92865-1.c @@ -0,0 +1,67 @@ +/* PR target/92865 */ +/* { dg-do compile } */ +/* { dg-options "-Ofast -mavx512f -mavx512bw -mxop" } */ +/* { dg-final { scan-assembler-times "vpcmp\[bwdq\]\[\t ]" 4 } } */ +/* { dg-final { scan-assembler-times "vpcmpu\[bwdq\]\[\t ]" 4 } } */ +/* { dg-final { scan-assembler-times "vmovdq\[au\]8\[\t ]" 4 } } */ +/* { dg-final { scan-assembler-times "vmovdq\[au\]16\[\t ]" 4 } } * +/* { dg-final { scan-assembler-times "vmovdq\[au\]32\[\t ]" 4 } } */ +/* { dg-final { scan-assembler-times "vmovdq\[au\]64\[\t ]" 4 } } */ + +extern char arraysb[64]; +extern short arraysw[32]; +extern int arraysd[16]; +extern long long arraysq[8]; + +extern unsigned char arrayub[64]; +extern unsigned short arrayuw[32]; +extern unsigned int arrayud[16]; +extern unsigned long long arrayuq[8]; + +int f1(char a) +{ + for (int i = 0; i < 64; i++) + arraysb[i] = arraysb[i] >= a; +} + +int f2(short a) +{ + for (int i = 0; i < 32; i++) + arraysw[i] = arraysw[i] >= a; +} + +int f3(int a) +{ + for (int i = 0; i < 16; i++) + arraysd[i] = arraysd[i] >= a; +} + +int f4(long long a) +{ + for (int i = 0; i < 8; i++) + arraysq[i] = arraysq[i] >= a; +} + +int f5(unsigned char a) +{ + for (int i = 0; i < 64; i++) + arrayub[i] = arrayub[i] >= a; +} + +int f6(unsigned short a) +{ + for (int i = 0; i < 32; i++) + arrayuw[i] = arrayuw[i] >= a; +} + +int f7(unsigned int a) +{ + for (int i = 0; i < 16; i++) + arrayud[i] = arrayud[i] >= a; +} + +int f8(unsigned long long a) +{ + for (int i = 0; i < 8; i++) + arrayuq[i] = arrayuq[i] >= a; +}