annotate gcc/testsuite/gcc.dg/tree-ssa/pr69270.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-O2 -fsplit-paths -fdump-tree-dom3-details" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 /* There should be two references to bufferstep that turn into
kono
parents:
diff changeset
5 constants. */
kono
parents:
diff changeset
6 /* { dg-final { scan-tree-dump-times "Replaced .bufferstep_\[0-9\]+. with constant .0." 1 "dom3"} } */
kono
parents:
diff changeset
7 /* { dg-final { scan-tree-dump-times "Replaced .bufferstep_\[0-9\]+. with constant .1." 1 "dom3"} } */
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 /* And some assignments ought to fold down to constants. */
kono
parents:
diff changeset
10 /* { dg-final { scan-tree-dump-times "Folded to: _\[0-9\]+ = 1;" 1 "dom3"} } */
kono
parents:
diff changeset
11 /* { dg-final { scan-tree-dump-times "Folded to: _\[0-9\]+ = 0;" 1 "dom3"} } */
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 /* The XOR operations should have been optimized to constants. */
kono
parents:
diff changeset
14 /* { dg-final { scan-tree-dump-not "bit_xor" "dom3"} } */
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 extern int *stepsizeTable;
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 void
kono
parents:
diff changeset
20 adpcm_coder (signed char *outdata, int len)
kono
parents:
diff changeset
21 {
kono
parents:
diff changeset
22 signed char *outp;
kono
parents:
diff changeset
23 int delta;
kono
parents:
diff changeset
24 int outputbuffer;
kono
parents:
diff changeset
25 int bufferstep = 0;
kono
parents:
diff changeset
26 outp = (signed char *) outdata;
kono
parents:
diff changeset
27 int step = 0;
kono
parents:
diff changeset
28 int index = 0;
kono
parents:
diff changeset
29 int diff = 0;
kono
parents:
diff changeset
30 for (; len > 0; len--)
kono
parents:
diff changeset
31 {
kono
parents:
diff changeset
32 delta = 0;
kono
parents:
diff changeset
33 if (diff >= step)
kono
parents:
diff changeset
34 delta = 4;
kono
parents:
diff changeset
35 step = stepsizeTable[index];
kono
parents:
diff changeset
36 if (bufferstep)
kono
parents:
diff changeset
37 outputbuffer = (delta << 4) & 0xf0;
kono
parents:
diff changeset
38 else
kono
parents:
diff changeset
39 *outp++ = (delta & 0x0f) | outputbuffer;
kono
parents:
diff changeset
40 bufferstep = !bufferstep;
kono
parents:
diff changeset
41 }
kono
parents:
diff changeset
42 }