aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/combine_bfi_1.c
blob: cee42ccafcce0e0524f30fa6857abd902ca5779a (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
34
/* { dg-do compile } */
/* { dg-options "-O2" } */

int
f1 (int x, int y)
{
  return (x & ~0x0ffff00) | ((y << 8) & 0x0ffff00);
}

int
f2 (int x, int y)
{
  return (x & ~0x0ff000) | ((y & 0x0ff) << 12);
}

int
f3 (int x, int y)
{
  return (x & ~0xffff) | (y & 0xffff);
}

int
f4 (int x, int y)
{
  return (x & ~0xff) | (y & 0xff);
}

long long
f5 (long long x, long long y)
{
  return (x & ~0xffffffffull) | (y & 0xffffffff);
}

/* { dg-final { scan-assembler-times {\tbfi\t} 5 } } */