ubuntu-buildroot/output/build/host-gcc-initial-11.4.0/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-int-fwrapv.p7.c

20 lines
547 B
C
Raw Permalink Normal View History

2024-04-01 15:19:46 +00:00
/* Verify that overloaded built-ins for vec_abs with int
inputs produce the right results when -mcpu=power7 is specified. */
/* { dg-do compile } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-maltivec -O2 -mdejagnu-cpu=power7 -fwrapv" } */
#include <altivec.h>
vector signed int
test1 (vector signed int x)
{
return vec_abs (x);
}
/* { dg-final { scan-assembler-times "vspltisw|vxor" 1 } } */
/* { dg-final { scan-assembler-times "vsubuwm" 1 } } */
/* { dg-final { scan-assembler-times "vmaxsw" 1 } } */