1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2 < %s | FileCheck %s
5 ; LDNT1B, LDNT1W, LDNT1H, LDNT1D: vector base + scalar offset
6 ; ldnt1b { z0.s }, p0/z, [z0.s, x0]
10 define <vscale x 4 x i32> @gldnt1b_s(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %base, i64 %offset) {
11 ; CHECK-LABEL: gldnt1b_s:
13 ; CHECK-NEXT: ldnt1b { z0.s }, p0/z, [z0.s, x0]
15 %load = call <vscale x 4 x i8> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4i8.nxv4i32(<vscale x 4 x i1> %pg,
16 <vscale x 4 x i32> %base,
18 %res = zext <vscale x 4 x i8> %load to <vscale x 4 x i32>
19 ret <vscale x 4 x i32> %res
22 define <vscale x 2 x i64> @gldnt1b_d(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
23 ; CHECK-LABEL: gldnt1b_d:
25 ; CHECK-NEXT: ldnt1b { z0.d }, p0/z, [z0.d, x0]
27 %load = call <vscale x 2 x i8> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i8.nxv2i64(<vscale x 2 x i1> %pg,
28 <vscale x 2 x i64> %base,
30 %res = zext <vscale x 2 x i8> %load to <vscale x 2 x i64>
31 ret <vscale x 2 x i64> %res
35 define <vscale x 4 x i32> @gldnt1h_s(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %base, i64 %offset) {
36 ; CHECK-LABEL: gldnt1h_s:
38 ; CHECK-NEXT: ldnt1h { z0.s }, p0/z, [z0.s, x0]
40 %load = call <vscale x 4 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv416.nxv4i32(<vscale x 4 x i1> %pg,
41 <vscale x 4 x i32> %base,
43 %res = zext <vscale x 4 x i16> %load to <vscale x 4 x i32>
44 ret <vscale x 4 x i32> %res
47 define <vscale x 2 x i64> @gldnt1h_d(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
48 ; CHECK-LABEL: gldnt1h_d:
50 ; CHECK-NEXT: ldnt1h { z0.d }, p0/z, [z0.d, x0]
52 %load = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i16.nxv2i64(<vscale x 2 x i1> %pg,
53 <vscale x 2 x i64> %base,
55 %res = zext <vscale x 2 x i16> %load to <vscale x 2 x i64>
56 ret <vscale x 2 x i64> %res
60 define <vscale x 4 x i32> @gldnt1w_s(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %base, i64 %offset) {
61 ; CHECK-LABEL: gldnt1w_s:
63 ; CHECK-NEXT: ldnt1w { z0.s }, p0/z, [z0.s, x0]
65 %load = call <vscale x 4 x i32> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4i32.nxv4i32(<vscale x 4 x i1> %pg,
66 <vscale x 4 x i32> %base,
68 ret <vscale x 4 x i32> %load
71 define <vscale x 4 x float> @gldnt1w_s_float(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %base, i64 %offset) {
72 ; CHECK-LABEL: gldnt1w_s_float:
74 ; CHECK-NEXT: ldnt1w { z0.s }, p0/z, [z0.s, x0]
76 %load = call <vscale x 4 x float> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4f32.nxv4i32(<vscale x 4 x i1> %pg,
77 <vscale x 4 x i32> %base,
79 ret <vscale x 4 x float> %load
82 define <vscale x 2 x i64> @gldnt1w_d(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
83 ; CHECK-LABEL: gldnt1w_d:
85 ; CHECK-NEXT: ldnt1w { z0.d }, p0/z, [z0.d, x0]
87 %load = call <vscale x 2 x i32> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i32.nxv2i64(<vscale x 2 x i1> %pg,
88 <vscale x 2 x i64> %base,
90 %res = zext <vscale x 2 x i32> %load to <vscale x 2 x i64>
91 ret <vscale x 2 x i64> %res
95 define <vscale x 2 x i64> @gldnt1d_d(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
96 ; CHECK-LABEL: gldnt1d_d:
98 ; CHECK-NEXT: ldnt1d { z0.d }, p0/z, [z0.d, x0]
100 %load = call <vscale x 2 x i64> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i64.nxv2i64(<vscale x 2 x i1> %pg,
101 <vscale x 2 x i64> %base,
103 ret <vscale x 2 x i64> %load
107 define <vscale x 2 x double> @gldnt1d_d_double(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
108 ; CHECK-LABEL: gldnt1d_d_double:
110 ; CHECK-NEXT: ldnt1d { z0.d }, p0/z, [z0.d, x0]
112 %load = call <vscale x 2 x double> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2f64.nxv2i64(<vscale x 2 x i1> %pg,
113 <vscale x 2 x i64> %base,
115 ret <vscale x 2 x double> %load
119 ; LDNT1SB, LDNT1SW, LDNT1SH, LDNT1SD: vector base + scalar offset
120 ; ldnt1sb { z0.s }, p0/z, [z0.s, x0]
124 define <vscale x 4 x i32> @gldnt1sb_s(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %base, i64 %offset) {
125 ; CHECK-LABEL: gldnt1sb_s:
127 ; CHECK-NEXT: ldnt1sb { z0.s }, p0/z, [z0.s, x0]
129 %load = call <vscale x 4 x i8> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4i8.nxv4i32(<vscale x 4 x i1> %pg,
130 <vscale x 4 x i32> %base,
132 %res = sext <vscale x 4 x i8> %load to <vscale x 4 x i32>
133 ret <vscale x 4 x i32> %res
136 define <vscale x 2 x i64> @gldnt1sb_d(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
137 ; CHECK-LABEL: gldnt1sb_d:
139 ; CHECK-NEXT: ldnt1sb { z0.d }, p0/z, [z0.d, x0]
141 %load = call <vscale x 2 x i8> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i8.nxv2i64(<vscale x 2 x i1> %pg,
142 <vscale x 2 x i64> %base,
144 %res = sext <vscale x 2 x i8> %load to <vscale x 2 x i64>
145 ret <vscale x 2 x i64> %res
149 define <vscale x 4 x i32> @gldnt1sh_s(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %base, i64 %offset) {
150 ; CHECK-LABEL: gldnt1sh_s:
152 ; CHECK-NEXT: ldnt1sh { z0.s }, p0/z, [z0.s, x0]
154 %load = call <vscale x 4 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv416.nxv4i32(<vscale x 4 x i1> %pg,
155 <vscale x 4 x i32> %base,
157 %res = sext <vscale x 4 x i16> %load to <vscale x 4 x i32>
158 ret <vscale x 4 x i32> %res
161 define <vscale x 2 x i64> @gldnt1sh_d(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
162 ; CHECK-LABEL: gldnt1sh_d:
164 ; CHECK-NEXT: ldnt1sh { z0.d }, p0/z, [z0.d, x0]
166 %load = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i16.nxv2i64(<vscale x 2 x i1> %pg,
167 <vscale x 2 x i64> %base,
169 %res = sext <vscale x 2 x i16> %load to <vscale x 2 x i64>
170 ret <vscale x 2 x i64> %res
174 define <vscale x 2 x i64> @gldnt1sw_d(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
175 ; CHECK-LABEL: gldnt1sw_d:
177 ; CHECK-NEXT: ldnt1sw { z0.d }, p0/z, [z0.d, x0]
179 %load = call <vscale x 2 x i32> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i32.nxv2i64(<vscale x 2 x i1> %pg,
180 <vscale x 2 x i64> %base,
182 %res = sext <vscale x 2 x i32> %load to <vscale x 2 x i64>
183 ret <vscale x 2 x i64> %res
187 declare <vscale x 4 x i8> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4i8.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, i64)
188 declare <vscale x 2 x i8> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i8.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>, i64)
191 declare <vscale x 4 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv416.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, i64)
192 declare <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i16.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>, i64)
195 declare <vscale x 4 x i32> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4i32.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, i64)
196 declare <vscale x 2 x i32> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i32.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>, i64)
198 declare <vscale x 4 x float> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4f32.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, i64)
201 declare <vscale x 2 x i64> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i64.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>, i64)
203 declare <vscale x 2 x double> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2f64.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>, i64)