Debian Codegraph @

gcc/testsuite/gcc.target/vax/peephole2-le-andhi.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fdump-rtl-peephole2 -dp" } */
3 /* { dg-skip-if "code quality test" { *-*-* } { "-O0" "-O1" } { "" } } */
4
5 typedef int __attribute__ ((mode (HI))) int_t;
6
7 void
8 le_andhi (int_t *w, int_t *x, int_t *y)
9 {
10 int_t v;
11
12 v = *x & *y;
13 if (v <= 0)
14 *w = 1;
15 else
16 *w = 2;
17 }
18
19 /* Expect assembly like:
20
21 bitw *8(%ap),*12(%ap) # 56 [c=50] *bithi_ccnz
22 jleq .L6 # 46 [c=26] *branch_ccnz
23 movw $2,%r0 # 41 [c=4] *movhi
24 movw %r0,*4(%ap) # 40 [c=4] *movhi
25 ret # 52 [c=0] return
26 .L6:
27
28 */
29
30 /* { dg-final { scan-rtl-dump-times "Splitting with gen_peephole2" 1 "peephole2" } } */
31 /* { dg-final { scan-assembler-not "\t(cmpz?|tst). " } } */
32 /* { dg-final { scan-assembler "bithi\[^ \]*_ccnz(/\[0-9\]+)?\n" } } */
33 /* { dg-final { scan-assembler "branch_ccnz\n" } } */