Debian Codegraph @

gcc/testsuite/gcc.target/sh/pr51244-2.c

raw
1 /* Check that when taking the complement of the T bit using the negc
2 instruction pattern, the constant -1 is loaded only once on non-SH2A and
3 that the movrt insn is generated on SH2A.
4 /* { dg-do compile } */
5 /* { dg-options "-O1 -mbranch-cost=2" } */
6
7 /* { dg-final { scan-assembler-times "mov\t#-1" 1 { target { ! sh2a } } } } */
8 /* { dg-final { scan-assembler-times "movrt" 4 { target { sh2a } } } } */
9
10 void
11 testfunc_00 (int* a, int* b, int c, int d)
12 {
13 b[0] = a[0] != c;
14 b[1] = a[1] != d;
15 b[2] = a[2] != c;
16 b[3] = a[3] != d;
17 }
18