aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/fp16-aapcs-3.c
blob: 7238ef3a02e0351ec1e32c3945d0cd33a47216ac (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* { dg-do compile }  */
/* { dg-require-effective-target arm_hard_vfp_ok }  */
/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-O2" }  */
/* { dg-add-options arm_fp16_alternative } */
/* { dg-final { check-function-bodies "**" "" "" } } */

/* Test __fp16 arguments and return value in registers (hard-float).  */

void
swap (__fp16, __fp16);

/*
** F:
** ...
** (

Below block is for non-armv8.1
** (
**	vmov\.f32	(s[3-9]|s1[0-5]), s0
** ...
**	vmov\.f32	s0, s1
** ...
**	vmov\.f32	s1, \1
** |
**	vmov\.f32	(s[3-9]|s1[0-5]), s1
** ...
**	vmov\.f32	s1, s0
** ...
**	vmov\.f32	s0, \2
** )
**	vstr\.32	s2, \[sp, #4\]	@ int
**	bl	swap
**	vldr\.32	s2, \[sp, #4\]	@ int
**	vmov\.f32	s0, s2

** |

Below block is for armv8.1
** (
**	vmov	(s[3-9]|s1[0-5]), s0
** ...
**	vmov	s0, s1
** ...
**	vmov	s1, \3
** |
**	vmov	(s[3-9]|s1[0-5]), s1
** ...
**	vmov	s1, s0
** ...
**	vmov	s0, \4
** )
**	vstr\.32	s2, \[sp, #4\]	@ int
**	bl	swap
**	vldr\.16	s0, \[sp, #4\]

** )
** ...
*/
__fp16
F (__fp16 a, __fp16 b, __fp16 c)
{
  swap (b, a);
  return c;
}