1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-require-effective-target powerpc_p9modulo_ok } */
3 /* { dg-options "-mdejagnu-cpu=power9 -O2" } */
4
ismod(int a,int b)5 int ismod (int a, int b) { return a%b; }
lsmod(long a,long b)6 long lsmod (long a, long b) { return a%b; }
iumod(unsigned int a,unsigned int b)7 unsigned int iumod (unsigned int a, unsigned int b) { return a%b; }
lumod(unsigned long a,unsigned long b)8 unsigned long lumod (unsigned long a, unsigned long b) { return a%b; }
9
10 /* { dg-final { scan-assembler-times "modsw " 1 } } */
11 /* { dg-final { scan-assembler-times "modsd " 1 } } */
12 /* { dg-final { scan-assembler-times "moduw " 1 } } */
13 /* { dg-final { scan-assembler-times "modud " 1 } } */
14 /* { dg-final { scan-assembler-not "mullw " } } */
15 /* { dg-final { scan-assembler-not "mulld " } } */
16 /* { dg-final { scan-assembler-not "divw " } } */
17 /* { dg-final { scan-assembler-not "divd " } } */
18 /* { dg-final { scan-assembler-not "divwu " } } */
19 /* { dg-final { scan-assembler-not "divdu " } } */
20