* gcc.target/powerpc/builtins-1-be.c <vclzb>: Rename duplicate test
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / clone1.c
blobeb13a7b2dbd42c9294cde1b13f51c1523f3c2442
1 /* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
2 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
3 /* { dg-options "-mcpu=power8 -O2" } */
4 /* { dg-require-effective-target powerpc_p9vector_ok } */
5 /* { dg-require-effective-target ppc_cpu_supports_hw } */
7 /* Power9 (aka, ISA 3.0) has a MODSD instruction to do modulus, while Power8
8 (aka, ISA 2.07) has to do modulus with divide and multiply. Make sure
9 both clone functions are generated.
11 Restrict ourselves to Linux, since IFUNC might not be supported in other
12 operating systems. */
14 __attribute__((target_clones("cpu=power9,default")))
15 long mod_func (long a, long b)
17 return a % b;
20 long mod_func_or (long a, long b, long c)
22 return mod_func (a, b) | c;
25 /* { dg-final { scan-assembler-times {\mdivd\M} 1 } } */
26 /* { dg-final { scan-assembler-times {\mmulld\M} 1 } } */
27 /* { dg-final { scan-assembler-times {\mmodsd\M} 1 } } */