summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/construct_lane_zero_1.c
blob: d87f32908280cf7f6ad89d129f0005510ba7cced (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
35
36
37
/* { dg-do compile } */
/* { dg-options "-O2" } */

typedef long long v2di __attribute__ ((vector_size (16)));
typedef double v2df __attribute__ ((vector_size (16)));

v2di
construct_lanedi (long long *y)
{
  v2di x =
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
  { 0, y[0] }
#else
  { y[0], 0 }
#endif
  ;
  return x;
}

v2df
construct_lanedf (double *y)
{
  v2df x =
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
  { 0.0, y[0] }
#else
  { y[0], 0.0 }
#endif
  ;
  return x;
}

/* Check that creating V2DI and V2DF vectors from a lane with a zero
   makes use of the D-reg LDR rather than doing explicit lane inserts.  */

/* { dg-final { scan-assembler-times "ldr\td\[0-9\]+" 2 } } */
/* { dg-final { scan-assembler-not "ins\t" } } */