• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2 < %s 2>%t | FileCheck %s
2; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t
3
4; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it.
5; WARN-NOT: warning
6
7;
8; LDNT1H, LDNT1W, LDNT1D: base + 64-bit index
9;   e.g.
10;     lsl z0.d, z0.d, #1
11;     ldnt1h z0.d, p0/z, [z0.d, x0]
12;
13
14define <vscale x 2 x i64> @gldnt1h_index(<vscale x 2 x i1> %pg, i16* %base, <vscale x 2 x i64> %b) {
15; CHECK-LABEL: gldnt1h_index
16; CHECK:        lsl z0.d, z0.d, #1
17; CHECK-NEXT:   ldnt1h  { z0.d }, p0/z, [z0.d, x0]
18; CHECK-NEXT:   ret
19  %load = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i16(<vscale x 2 x i1> %pg,
20                                                                               i16* %base,
21                                                                               <vscale x 2 x i64> %b)
22  %res = zext <vscale x 2 x i16> %load to <vscale x 2 x i64>
23  ret <vscale x 2 x i64> %res
24}
25
26define <vscale x 2 x i64> @gldnt1w_index(<vscale x 2 x i1> %pg, i32* %base, <vscale x 2 x i64> %b) {
27; CHECK-LABEL: gldnt1w_index
28; CHECK:        lsl z0.d, z0.d, #2
29; CHECK-NEXT:   ldnt1w  { z0.d }, p0/z, [z0.d, x0]
30; CHECK-NEXT:   ret
31  %load = call <vscale x 2 x i32> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i32(<vscale x 2 x i1> %pg,
32                                                                               i32* %base,
33                                                                               <vscale x 2 x i64> %b)
34  %res = zext <vscale x 2 x i32> %load to <vscale x 2 x i64>
35  ret <vscale x 2 x i64> %res
36}
37
38define <vscale x 2 x i64> @gldnt1d_index(<vscale x 2 x i1> %pg, i64* %base, <vscale x 2 x i64> %b) {
39; CHECK-LABEL: gldnt1d_index
40; CHECK:        lsl z0.d, z0.d, #3
41; CHECK-NEXT:   ldnt1d  { z0.d }, p0/z, [z0.d, x0]
42; CHECK-NEXT:   ret
43  %load = call <vscale x 2 x i64> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i64(<vscale x 2 x i1> %pg,
44                                                                               i64* %base,
45                                                                               <vscale x 2 x i64> %b)
46  ret <vscale x 2 x i64> %load
47}
48
49define <vscale x 2 x double> @gldnt1d_index_double(<vscale x 2 x i1> %pg, double* %base, <vscale x 2 x i64> %b) {
50; CHECK-LABEL: gldnt1d_index_double
51; CHECK:        lsl z0.d, z0.d, #3
52; CHECK-NEXT:   ldnt1d  { z0.d }, p0/z, [z0.d, x0]
53; CHECK-NEXT:   ret
54  %load = call <vscale x 2 x double> @llvm.aarch64.sve.ldnt1.gather.index.nxv2f64(<vscale x 2 x i1> %pg,
55                                                                                  double* %base,
56                                                                                  <vscale x 2 x i64> %b)
57  ret <vscale x 2 x double> %load
58}
59
60;
61; LDNT1SH, LDNT1SW: base + 64-bit index
62;   e.g.
63;     lsl z0.d, z0.d, #1
64;     ldnt1sh z0.d, p0/z, [z0.d, x0]
65;
66
67define <vscale x 2 x i64> @gldnt1sh_index(<vscale x 2 x i1> %pg, i16* %base, <vscale x 2 x i64> %b) {
68; CHECK-LABEL: gldnt1sh_index
69; CHECK:        lsl z0.d, z0.d, #1
70; CHECK-NEXT:   ldnt1sh { z0.d }, p0/z, [z0.d, x0]
71; CHECK-NEXT:   ret
72  %load = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i16(<vscale x 2 x i1> %pg,
73                                                                               i16* %base,
74                                                                               <vscale x 2 x i64> %b)
75  %res = sext <vscale x 2 x i16> %load to <vscale x 2 x i64>
76  ret <vscale x 2 x i64> %res
77}
78
79define <vscale x 2 x i64> @gldnt1sw_index(<vscale x 2 x i1> %pg, i32* %base, <vscale x 2 x i64> %b) {
80; CHECK-LABEL: gldnt1sw_index
81; CHECK:        lsl z0.d, z0.d, #2
82; CHECK-NEXT:   ldnt1sw { z0.d }, p0/z, [z0.d, x0]
83; CHECK-NEXT:   ret
84  %load = call <vscale x 2 x i32> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i32(<vscale x 2 x i1> %pg,
85                                                                               i32* %base,
86                                                                               <vscale x 2 x i64> %b)
87  %res = sext <vscale x 2 x i32> %load to <vscale x 2 x i64>
88  ret <vscale x 2 x i64> %res
89}
90
91declare <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i16(<vscale x 2 x i1>, i16*, <vscale x 2 x i64>)
92declare <vscale x 2 x i32> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i32(<vscale x 2 x i1>, i32*, <vscale x 2 x i64>)
93declare <vscale x 2 x i64> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i64(<vscale x 2 x i1>, i64*, <vscale x 2 x i64>)
94declare <vscale x 2 x double> @llvm.aarch64.sve.ldnt1.gather.index.nxv2f64(<vscale x 2 x i1>, double*, <vscale x 2 x i64>)
95