|
16 | 16 | ; RUN: -stop-before=ppc-vsx-copy | FileCheck %s --check-prefix CHECK32LARGE |
17 | 17 | ; RUN: llc -mtriple powerpc-ibm-aix-xcoff -code-model=large -verify-machineinstrs < %s | FileCheck %s --check-prefix TEST32LARGE |
18 | 18 |
|
| 19 | +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -code-model=large -verify-machineinstrs < %s \ |
| 20 | +; RUN: -stop-before=ppc-vsx-copy | FileCheck %s --check-prefix CHECK64LARGE |
| 21 | +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -code-model=large -verify-machineinstrs < %s | FileCheck %s --check-prefix TEST64LARGE |
| 22 | + |
19 | 23 | ; Global variables i and f have the toc-data attribute. |
20 | 24 | ; In the following functions, those writing to or reading from |
21 | 25 | ; variables i and f should use the toc-data access pattern. |
@@ -63,6 +67,17 @@ define dso_local void @write_int(i32 signext %in) { |
63 | 67 | ; TEST32LARGE-NEXT: la 4, i[TD]@l(4) |
64 | 68 | ; TEST32LARGE-NEXT: stw 3, 0(4) |
65 | 69 |
|
| 70 | + |
| 71 | +; CHECK64LARGE: name: write_int |
| 72 | +; CHECK64LARGE: %[[SCRATCH1:[0-9]+]]:g8rc_and_g8rc_nox0 = ADDIStocHA8 $x2, @i |
| 73 | +; CHECK64LARGE-NEXT: %[[SCRATCH2:[0-9]+]]:g8rc_and_g8rc_nox0 = ADDItocL8 killed %[[SCRATCH1]], @i |
| 74 | +; CHECK64LARGE-NEXT: STW8 %{{[0-9]+}}, 0, killed %[[SCRATCH2]] :: (store (s32) into @i) |
| 75 | + |
| 76 | +; TEST64LARGE: .write_int: |
| 77 | +; TEST64LARGE: addis 4, i[TD]@u(2) |
| 78 | +; TEST64LARGE-NEXT: la 4, i[TD]@l(4) |
| 79 | +; TEST64LARGE-NEXT: stw 3, 0(4) |
| 80 | + |
66 | 81 | define dso_local i64 @read_ll() { |
67 | 82 | entry: |
68 | 83 | %0 = load i64, ptr @ll, align 8 |
@@ -98,6 +113,15 @@ define dso_local i64 @read_ll() { |
98 | 113 | ; TEST32LARGE-NEXT: lwz 3, 0(4) |
99 | 114 | ; TEST32LARGE-NEXT: lwz 4, 4(4) |
100 | 115 |
|
| 116 | +; CHECK64LARGE: name: read_ll |
| 117 | +; CHECK64LARGE: %[[SCRATCH1:[0-9]+]]:g8rc_and_g8rc_nox0 = ADDIStocHA8 $x2, @ll |
| 118 | +; CHECK64LARGE: LDtocL @ll, killed %[[SCRATCH1]] :: (load (s64) from got) |
| 119 | + |
| 120 | +; TEST64LARGE: .read_ll: |
| 121 | +; TEST64LARGE: addis 3, L..C0@u(2) |
| 122 | +; TEST64LARGE-NEXT: ld 3, L..C0@l(3) |
| 123 | +; TEST64LARGE-NEXT: ld 3, 0(3) |
| 124 | + |
101 | 125 | define dso_local float @read_float() { |
102 | 126 | entry: |
103 | 127 | %0 = load float, ptr @f, align 4 |
@@ -134,6 +158,18 @@ define dso_local float @read_float() { |
134 | 158 | ; TEST32LARGE-NEXT: la 3, f[TD]@l(3) |
135 | 159 | ; TEST32LARGE-NEXT: lfs 1, 0(3) |
136 | 160 |
|
| 161 | + |
| 162 | +; CHECK64LARGE: name: read_float |
| 163 | +; CHECK64LARGE: %[[SCRATCH1:[0-9]+]]:g8rc_and_g8rc_nox0 = ADDIStocHA8 $x2, @f |
| 164 | +; CHECK64LARGE-NEXT: %[[SCRATCH2:[0-9]+]]:g8rc_and_g8rc_nox0 = ADDItocL8 killed %[[SCRATCH1]], @f |
| 165 | +; CHECK64LARGE-NEXT: LFS 0, killed %[[SCRATCH2]] :: (dereferenceable load (s32) from @f) |
| 166 | + |
| 167 | + |
| 168 | +; TEST64LARGE: .read_float: |
| 169 | +; TEST64LARGE: addis 3, f[TD]@u(2) |
| 170 | +; TEST64LARGE-NEXT: la 3, f[TD]@l(3) |
| 171 | +; TEST64LARGE-NEXT: lfs 1, 0(3) |
| 172 | + |
137 | 173 | define dso_local void @write_double(double %in) { |
138 | 174 | entry: |
139 | 175 | store double %in, ptr @d, align 8 |
@@ -167,6 +203,15 @@ define dso_local void @write_double(double %in) { |
167 | 203 | ; TEST32LARGE-NEXT: lwz 3, L..C1@l(3) |
168 | 204 | ; TEST32LARGE-NEXT: stfd 1, 0(3) |
169 | 205 |
|
| 206 | +; CHECK64LARGE: name: write_double |
| 207 | +; CHECK64LARGE: %[[SCRATCH1:[0-9]+]]:g8rc_and_g8rc_nox0 = ADDIStocHA8 $x2, @d |
| 208 | +; CHECK64LARGE: LDtocL @d, killed %[[SCRATCH1]] :: (load (s64) from got) |
| 209 | + |
| 210 | +; TEST64LARGE: .write_double: |
| 211 | +; TEST64LARGE: addis 3, L..C1@u(2) |
| 212 | +; TEST64LARGE-NEXT: ld 3, L..C1@l(3) |
| 213 | +; TEST64LARGE-NEXT: stfd 1, 0(3) |
| 214 | + |
170 | 215 | define dso_local nonnull ptr @addr() { |
171 | 216 | entry: |
172 | 217 | ret ptr @i |
@@ -237,4 +282,26 @@ define dso_local nonnull ptr @addr() { |
237 | 282 | ; TEST32LARGE-NEXT: .globl f[TD] |
238 | 283 | ; TEST32LARGE-NOT: .tc f[TE],f[RW] |
239 | 284 |
|
| 285 | +; CHECK64LARGE: name: addr |
| 286 | +; CHECK64LARGE: %[[SCRATCH1:[0-9]+]]:g8rc_and_g8rc_nox0 = ADDIStocHA8 $x2, @i |
| 287 | +; CHECK64LARGE-NEXT: %[[SCRATCH2:[0-9]+]]:g8rc = ADDItocL8 killed %[[SCRATCH1]], @i |
| 288 | +; CHECK64LARGE-NEXT: $x3 = COPY %[[SCRATCH2]] |
| 289 | + |
| 290 | +; TEST64LARGE: .addr: |
| 291 | +; TEST64LARGE: addis 3, i[TD]@u(2) |
| 292 | +; TEST64LARGE: la 3, i[TD]@l(3) |
| 293 | + |
| 294 | +; TEST64LARGE: .toc |
| 295 | +; TEST64LARGE: .tc ll[TE],ll[RW] |
| 296 | +; TEST64LARGE-NOT: .csect ll[TD] |
| 297 | +; TEST64LARGE: .tc d[TE],d[RW] |
| 298 | +; TEST64LARGE-NOT: .csect d[TD],2 |
| 299 | +; TEST64LARGE: .csect i[TD],2 |
| 300 | +; TEST64LARGE-NEXT: .globl i[TD] |
| 301 | +; TEST64LARGE-NEXT: .align 2 |
| 302 | +; TEST64LARGE-NOT: .tc i[TE],i[RW] |
| 303 | +; TEST64LARGE: .csect f[TD],2 |
| 304 | +; TEST64LARGE-NEXT: .globl f[TD] |
| 305 | +; TEST64LARGE-NOT: .tc f[TE],f[RW] |
| 306 | + |
240 | 307 | attributes #0 = { "toc-data" } |
0 commit comments