summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_2.c
blob: 6f44821e9d08d4c3b87eb52b70491183a32ac2ff (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
38
39
40
41
42
43
44
45
/* { dg-do compile } */
/* { dg-options "-O3" } */
/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
/* { dg-add-options arm_v8_2a_fp16_scalar } */

#include <arm_fp16.h>

float16_t f0(void)
{
  float16_t x = 0.0f;
  return x;
}

float16_t fn1(void)
{
  float16_t x = -0.0f;
  return x;
}

float16_t f1(void)
{
  float16_t x = 256.0f;
  return x;
}

float16_t f2(void)
{
  float16_t x = 123256.0f;
  return x;
}

float16_t f3(void)
{
  float16_t x = 17.0;
  return x;
}

/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.4h, ?#0"         1 } } */
/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0x80, lsl 8" 1 } } */
/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0x5c, lsl 8" 1 } } */
/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0x7c, lsl 8" 1 } } */

/* { dg-final { scan-assembler-times "mov\tw\[0-9\]+, 19520"              1 } } */
/* { dg-final { scan-assembler-times "fmov\th\[0-9\], w\[0-9\]+"          1 } } */