summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/vax/peephole2-lt-andqi.c
blob: d71c46dad866e4e492034414383efea871866132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* { dg-do compile } */
/* { dg-options "-fdump-rtl-peephole2 -dp" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" "-O1" } { "" } } */

typedef int __attribute__ ((mode (QI))) int_t;

void
lt_andqi (int_t *w, int_t *x, int_t *y)
{
  int_t v;

  v = *x & *y;
  if (v < 0)
    *w = 1;
  else
    *w = 2;
}

/* Expect assembly like:

	bitb *8(%ap),*12(%ap)		# 68	[c=50]  *bitqi_ccn
	jlss .L6			# 58	[c=26]  *branch_ccn
	movb $2,%r0			# 53	[c=4]  *movqi
	movb %r0,*4(%ap)		# 52	[c=4]  *movqi
	ret				# 64	[c=0]  return
.L6:

 */

/* { dg-final { scan-rtl-dump-times "Splitting with gen_peephole2" 1 "peephole2" } } */
/* { dg-final { scan-assembler-not "\t(cmpz?|tst). " } } */
/* { dg-final { scan-assembler "bitqi\[^ \]*_ccn(/\[0-9\]+)?\n" } } */
/* { dg-final { scan-assembler "branch_ccn\n" } } */