(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
vax/
peephole2-eq-andhi.c
       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  eq_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)		# 50	[c=50]  *bithi_ccz
      22  	jneq .L3			# 40	[c=26]  *branch_ccz
      23  	movw $1,%r0			# 36	[c=4]  *movhi
      24  	movw %r0,*4(%ap)		# 34	[c=4]  *movhi
      25  	ret				# 46	[c=0]  return
      26  .L3:
      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\[^ \]*_ccz(/\[0-9\]+)?\n" } } */
      33  /* { dg-final { scan-assembler "branch_ccz\n" } } */