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
14 __attribute__((target_clones("cpu=power9,default")))
15 long mod_func (long a
, long 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 } } */