annotate gcc/testsuite/gcc.dg/divmod-6-simode.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-require-effective-target divmod_simode } */
kono
parents:
diff changeset
2 /* { dg-options "-O2 -fdump-tree-widening_mul-details" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 typedef int SImode __attribute__((mode(SI)));
kono
parents:
diff changeset
5 typedef unsigned USImode __attribute__((mode(SI)));
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 extern int cond;
kono
parents:
diff changeset
8 void foo(void);
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 #define FOO(smalltype, bigtype, no) \
kono
parents:
diff changeset
11 bigtype f_##no(smalltype x, bigtype y) \
kono
parents:
diff changeset
12 { \
kono
parents:
diff changeset
13 bigtype q = x / y; \
kono
parents:
diff changeset
14 bigtype r1 = 0, r2 = 0; \
kono
parents:
diff changeset
15 if (cond) \
kono
parents:
diff changeset
16 r1 = x % y; \
kono
parents:
diff changeset
17 else \
kono
parents:
diff changeset
18 r2 = x % y; \
kono
parents:
diff changeset
19 return q + r1 + r2; \
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 FOO(SImode, SImode, 1)
kono
parents:
diff changeset
23 FOO(SImode, USImode, 2)
kono
parents:
diff changeset
24 FOO(USImode, USImode, 3)
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 /* { dg-final { scan-tree-dump-times "DIVMOD" 3 "widening_mul" } } */