Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/fp8_scalar_1.c

raw
1 /* Test the fp8 ACLE intrinsics family. */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -march=armv9.4-a+fp8" } */
4 /* { dg-final { check-function-bodies "**" "" "" } } */
5
6 #include <arm_neon.h>
7
8 /*
9 **stacktest1:
10 ** sub sp, sp, #16
11 ** str b0, \[sp, 15\]
12 ** ldr b0, \[sp, 15\]
13 ** add sp, sp, 16
14 ** ret
15 */
16 mfloat8_t
17 stacktest1 (mfloat8_t __a)
18 {
19 volatile mfloat8_t b = __a;
20 return b;
21 }
22
23 /*
24 **fp8_mov_ww:
25 ** dup b1, v2.b\[0\]
26 ** ret
27 */
28 void
29 fp8_mov_ww (void)
30 {
31 register mfloat8_t x asm ("h2");
32 register mfloat8_t y asm ("h1");
33 asm volatile ("" : "=w"(x));
34 y = x;
35 asm volatile ("" ::"w"(y));
36 }
37
38 /*
39 **fp8_mov_rw:
40 ** dup v1.8b, w1
41 ** ret
42 */
43 void
44 fp8_mov_rw (void)
45 {
46 register mfloat8_t x asm ("w1");
47 register mfloat8_t y asm ("h1");
48 asm volatile ("" : "=r"(x));
49 y = x;
50 asm volatile ("" ::"w"(y));
51 }
52
53 /*
54 **fp8_mov_wr:
55 ** umov w1, v1.b\[0\]
56 ** ret
57 */
58 void
59 fp8_mov_wr (void)
60 {
61 register mfloat8_t x asm ("h1");
62 register mfloat8_t y asm ("w1");
63 asm volatile ("" : "=w"(x));
64 y = x;
65 asm volatile ("" ::"r"(y));
66 }
67
68 /*
69 **fp8_mov_rr:
70 ** mov w1, w2
71 ** ret
72 */
73 void
74 fp8_mov_rr (void)
75 {
76 register mfloat8_t x asm ("w2");
77 register mfloat8_t y asm ("w1");
78 asm volatile ("" : "=r"(x));
79 y = x;
80 asm volatile ("" ::"r"(y));
81 }
82
83 /*
84 **fp8_mov_rm:
85 ** strb w2, \[x0\]
86 ** ret
87 */
88 void
89 fp8_mov_rm (mfloat8_t *ptr)
90 {
91 register mfloat8_t x asm ("w2");
92 asm volatile ("" : "=r"(x));
93 *ptr = x;
94 }
95
96 /*
97 **fp8_mov_mr:
98 ** ldrb w2, \[x0\]
99 ** ret
100 */
101 void
102 fp8_mov_mr (mfloat8_t *ptr)
103 {
104 register mfloat8_t y asm ("w2");
105 y = *ptr;
106 asm volatile ("" ::"r"(y));
107 }
108
109 /*
110 **fp8_str_r:
111 ** str b2, \[x0\]
112 ** ret
113 */
114 void
115 fp8_str_r (mfloat8_t *ptr)
116 {
117 register mfloat8_t x asm ("v2");
118 asm volatile ("" : "=w"(x));
119 *ptr = x;
120 }
121
122 /*
123 **fp8_ldr_r:
124 ** ldr b2, \[x0\]
125 ** ret
126 */
127 void
128 fp8_ldr_r (mfloat8_t *ptr)
129 {
130 register mfloat8_t y asm ("v2");
131 y = *ptr;
132 asm volatile ("" ::"w"(y));
133 }