x86: Add a testcase for PR target/96861
Add a testcase to verify that -march=skylake-avx512 -mtune=skylake-avx512 generates desired code sequence. PR target/96861 * gcc.target/i386/pr96861.c: New test.
This commit is contained in:
parent
e5d72c840a
commit
c66c004ad6
38
gcc/testsuite/gcc.target/i386/pr96861.c
Normal file
38
gcc/testsuite/gcc.target/i386/pr96861.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -mstv -march=skylake-avx512 -mtune=skylake-avx512" } */
|
||||
|
||||
#define max(a,b) (((a) > (b))? (a) : (b))
|
||||
#define min(a,b) (((a) < (b))? (a) : (b))
|
||||
|
||||
int smax1(int x)
|
||||
{
|
||||
return max(x,1);
|
||||
}
|
||||
|
||||
int smin1(int x)
|
||||
{
|
||||
return min(x,1);
|
||||
}
|
||||
|
||||
int smaxm1(int x)
|
||||
{
|
||||
return max(x,-1);
|
||||
}
|
||||
|
||||
int sminm1(int x)
|
||||
{
|
||||
return min(x,-1);
|
||||
}
|
||||
|
||||
unsigned int umax1(unsigned int x)
|
||||
{
|
||||
return max(x,1);
|
||||
}
|
||||
|
||||
unsigned int umin1(unsigned int x)
|
||||
{
|
||||
return min(x,1);
|
||||
}
|
||||
|
||||
/* { dg-final { scan-assembler-times "test" 6 } } */
|
||||
/* { dg-final { scan-assembler-not "cmp" } } */
|
Loading…
Reference in New Issue
Block a user