1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming-compatible-sve < %s | FileCheck %s
5 target triple = "aarch64-unknown-linux-gnu"
7 define void @bitcast_v4i8(ptr %a, ptr %b) {
8 ; CHECK-LABEL: bitcast_v4i8:
10 ; CHECK-NEXT: ptrue p0.h, vl4
11 ; CHECK-NEXT: ld1b { z0.h }, p0/z, [x0]
12 ; CHECK-NEXT: st1b { z0.h }, p0, [x1]
14 %load = load volatile <4 x i8>, ptr %a
15 %cast = bitcast <4 x i8> %load to <4 x i8>
16 store volatile <4 x i8> %cast, ptr %b
20 define void @bitcast_v8i8(ptr %a, ptr %b) {
21 ; CHECK-LABEL: bitcast_v8i8:
23 ; CHECK-NEXT: ldr d0, [x0]
24 ; CHECK-NEXT: str d0, [x1]
26 %load = load volatile <8 x i8>, ptr %a
27 %cast = bitcast <8 x i8> %load to <8 x i8>
28 store volatile <8 x i8> %cast, ptr %b
32 define void @bitcast_v16i8(ptr %a, ptr %b) {
33 ; CHECK-LABEL: bitcast_v16i8:
35 ; CHECK-NEXT: ldr q0, [x0]
36 ; CHECK-NEXT: str q0, [x1]
38 %load = load volatile <16 x i8>, ptr %a
39 %cast = bitcast <16 x i8> %load to <16 x i8>
40 store volatile <16 x i8> %cast, ptr %b
44 define void @bitcast_v32i8(ptr %a, ptr %b) {
45 ; CHECK-LABEL: bitcast_v32i8:
47 ; CHECK-NEXT: ldr q0, [x0]
48 ; CHECK-NEXT: ldr q1, [x0, #16]
49 ; CHECK-NEXT: str q1, [x1, #16]
50 ; CHECK-NEXT: str q0, [x1]
52 %load = load volatile <32 x i8>, ptr %a
53 %cast = bitcast <32 x i8> %load to <32 x i8>
54 store volatile <32 x i8> %cast, ptr %b
58 define void @bitcast_v2i16(ptr %a, ptr %b) {
59 ; CHECK-LABEL: bitcast_v2i16:
61 ; CHECK-NEXT: sub sp, sp, #16
62 ; CHECK-NEXT: .cfi_def_cfa_offset 16
63 ; CHECK-NEXT: ldrh w8, [x0, #2]
64 ; CHECK-NEXT: str w8, [sp, #4]
65 ; CHECK-NEXT: ldrh w8, [x0]
66 ; CHECK-NEXT: str w8, [sp]
67 ; CHECK-NEXT: ldr d0, [sp]
68 ; CHECK-NEXT: mov z1.s, z0.s[1]
69 ; CHECK-NEXT: fmov w8, s0
70 ; CHECK-NEXT: strh w8, [sp, #8]
71 ; CHECK-NEXT: fmov w8, s1
72 ; CHECK-NEXT: strh w8, [sp, #10]
73 ; CHECK-NEXT: ldr d0, [sp, #8]
74 ; CHECK-NEXT: fmov w8, s0
75 ; CHECK-NEXT: str w8, [x1]
76 ; CHECK-NEXT: add sp, sp, #16
78 %load = load volatile <2 x i16>, ptr %a
79 %cast = bitcast <2 x i16> %load to <2 x half>
80 store volatile <2 x half> %cast, ptr %b
84 define void @bitcast_v4i16(ptr %a, ptr %b) {
85 ; CHECK-LABEL: bitcast_v4i16:
87 ; CHECK-NEXT: ldr d0, [x0]
88 ; CHECK-NEXT: str d0, [x1]
90 %load = load volatile <4 x i16>, ptr %a
91 %cast = bitcast <4 x i16> %load to <4 x half>
92 store volatile <4 x half> %cast, ptr %b
96 define void @bitcast_v8i16(ptr %a, ptr %b) {
97 ; CHECK-LABEL: bitcast_v8i16:
99 ; CHECK-NEXT: ldr q0, [x0]
100 ; CHECK-NEXT: str q0, [x1]
102 %load = load volatile <8 x i16>, ptr %a
103 %cast = bitcast <8 x i16> %load to <8 x half>
104 store volatile <8 x half> %cast, ptr %b
108 define void @bitcast_v16i16(ptr %a, ptr %b) {
109 ; CHECK-LABEL: bitcast_v16i16:
111 ; CHECK-NEXT: ldr q0, [x0]
112 ; CHECK-NEXT: ldr q1, [x0, #16]
113 ; CHECK-NEXT: str q1, [x1, #16]
114 ; CHECK-NEXT: str q0, [x1]
116 %load = load volatile <16 x i16>, ptr %a
117 %cast = bitcast <16 x i16> %load to <16 x half>
118 store volatile <16 x half> %cast, ptr %b
122 define void @bitcast_v2i32(ptr %a, ptr %b) {
123 ; CHECK-LABEL: bitcast_v2i32:
125 ; CHECK-NEXT: ldr d0, [x0]
126 ; CHECK-NEXT: str d0, [x1]
128 %load = load volatile <2 x i32>, ptr %a
129 %cast = bitcast <2 x i32> %load to <2 x float>
130 store volatile <2 x float> %cast, ptr %b
134 define void @bitcast_v4i32(ptr %a, ptr %b) {
135 ; CHECK-LABEL: bitcast_v4i32:
137 ; CHECK-NEXT: ldr q0, [x0]
138 ; CHECK-NEXT: str q0, [x1]
140 %load = load volatile <4 x i32>, ptr %a
141 %cast = bitcast <4 x i32> %load to <4 x float>
142 store volatile <4 x float> %cast, ptr %b
146 define void @bitcast_v8i32(ptr %a, ptr %b) {
147 ; CHECK-LABEL: bitcast_v8i32:
149 ; CHECK-NEXT: ldr q0, [x0]
150 ; CHECK-NEXT: ldr q1, [x0, #16]
151 ; CHECK-NEXT: str q1, [x1, #16]
152 ; CHECK-NEXT: str q0, [x1]
154 %load = load volatile <8 x i32>, ptr %a
155 %cast = bitcast <8 x i32> %load to <8 x float>
156 store volatile <8 x float> %cast, ptr %b
160 define void @bitcast_v1i64(ptr %a, ptr %b) {
161 ; CHECK-LABEL: bitcast_v1i64:
163 ; CHECK-NEXT: ldr d0, [x0]
164 ; CHECK-NEXT: str d0, [x1]
166 %load = load volatile <1 x i64>, ptr %a
167 %cast = bitcast <1 x i64> %load to <1 x double>
168 store volatile <1 x double> %cast, ptr %b
172 define void @bitcast_v2i64(ptr %a, ptr %b) {
173 ; CHECK-LABEL: bitcast_v2i64:
175 ; CHECK-NEXT: ldr q0, [x0]
176 ; CHECK-NEXT: str q0, [x1]
178 %load = load volatile <2 x i64>, ptr %a
179 %cast = bitcast <2 x i64> %load to <2 x double>
180 store volatile <2 x double> %cast, ptr %b
184 define void @bitcast_v4i64(ptr %a, ptr %b) {
185 ; CHECK-LABEL: bitcast_v4i64:
187 ; CHECK-NEXT: ldr q0, [x0]
188 ; CHECK-NEXT: ldr q1, [x0, #16]
189 ; CHECK-NEXT: str q1, [x1, #16]
190 ; CHECK-NEXT: str q0, [x1]
192 %load = load volatile <4 x i64>, ptr %a
193 %cast = bitcast <4 x i64> %load to <4 x double>
194 store volatile <4 x double> %cast, ptr %b