1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
|
# RUN: llc -O0 -mattr=-fullfp16 -mtriple=aarch64-- \
# RUN: -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
--- |
define <2 x double> @test_v2s64_unmerge(<2 x double> %a) {
ret <2 x double> %a
}
define <4 x float> @test_v4s32_unmerge(<4 x float> %a) {
ret <4 x float> %a
}
define <4 x half> @test_v4s16_unmerge(<4 x half> %a) {
ret <4 x half> %a
}
define <8 x half> @test_v8s16_unmerge(<8 x half> %a) {
ret <8 x half> %a
}
define <2 x float> @test_vecsplit_2v2s32_v4s32(<4 x float> %a) {
ret <2 x float> undef
}
define <2 x half> @test_vecsplit_2v2s16_v4s16(<4 x half> %a) {
ret <2 x half> undef
}
define void @test_s128(i128 %p) { ret void }
...
---
name: test_v2s64_unmerge
alignment: 4
legalized: true
regBankSelected: true
tracksRegLiveness: true
registers:
- { id: 0, class: fpr }
- { id: 1, class: fpr }
- { id: 2, class: fpr }
- { id: 3, class: fpr }
body: |
bb.1 (%ir-block.0):
liveins: $q0
; CHECK-LABEL: name: test_v2s64_unmerge
%0:fpr(<2 x s64>) = COPY $q0
; Since 2 * 64 = 128, we can just directly copy.
; CHECK: %2:fpr64 = COPY %0.dsub
; CHECK: %3:fpr64 = CPYi64 %0, 1
%2:fpr(s64), %3:fpr(s64) = G_UNMERGE_VALUES %0(<2 x s64>)
%1:fpr(<2 x s64>) = G_BUILD_VECTOR %2(s64), %3(s64)
$q0 = COPY %1(<2 x s64>)
RET_ReallyLR implicit $q0
...
---
name: test_v4s32_unmerge
alignment: 4
legalized: true
regBankSelected: true
tracksRegLiveness: true
registers:
- { id: 0, class: fpr }
- { id: 1, class: fpr }
- { id: 2, class: fpr }
- { id: 3, class: fpr }
- { id: 4, class: fpr }
- { id: 5, class: fpr }
body: |
bb.1 (%ir-block.0):
liveins: $q0
; CHECK-LABEL: name: test_v4s32_unmerge
%0:fpr(<4 x s32>) = COPY $q0
; Since 4 * 32 = 128, we can just directly copy.
; CHECK: %2:fpr32 = COPY %0.ssub
; CHECK: %3:fpr32 = CPYi32 %0, 1
; CHECK: %4:fpr32 = CPYi32 %0, 2
; CHECK: %5:fpr32 = CPYi32 %0, 3
%2:fpr(s32), %3:fpr(s32), %4:fpr(s32), %5:fpr(s32) = G_UNMERGE_VALUES %0(<4 x s32>)
%1:fpr(<4 x s32>) = G_BUILD_VECTOR %2(s32), %3(s32), %4(s32), %5(s32)
$q0 = COPY %1(<4 x s32>)
RET_ReallyLR implicit $q0
...
---
name: test_v4s16_unmerge
alignment: 4
legalized: true
regBankSelected: true
tracksRegLiveness: true
registers:
- { id: 0, class: fpr }
- { id: 1, class: fpr }
- { id: 2, class: fpr }
- { id: 3, class: fpr }
- { id: 4, class: fpr }
- { id: 5, class: fpr }
body: |
bb.1 (%ir-block.0):
liveins: $d0
; CHECK-LABEL: name: test_v4s16_unmerge
%0:fpr(<4 x s16>) = COPY $d0
; Since 4 * 16 != 128, we need to widen using implicit defs.
; Note that we expect to reuse one of the INSERT_SUBREG results, as CPYi16
; expects a lane > 0.
; CHECK-DAG: [[IMPDEF1:%[0-9]+]]:fpr128 = IMPLICIT_DEF
; CHECK-NEXT: [[INS_SHARED:%[0-9]+]]:fpr128 = INSERT_SUBREG [[IMPDEF1]], %0, %subreg.dsub
; CHECK: [[IMPDEF2:%[0-9]+]]:fpr128 = IMPLICIT_DEF
; CHECK-NEXT: [[INS2:%[0-9]+]]:fpr128 = INSERT_SUBREG [[IMPDEF2]], %0, %subreg.dsub
; CHECK: [[IMPDEF3:%[0-9]+]]:fpr128 = IMPLICIT_DEF
; CHECK-NEXT: [[INS3:%[0-9]+]]:fpr128 = INSERT_SUBREG [[IMPDEF3]], %0, %subreg.dsub
; CHECK: %2:fpr16 = COPY [[INS_SHARED]].hsub
; CHECK: %3:fpr16 = CPYi16 [[INS_SHARED]], 1
; CHECK: %4:fpr16 = CPYi16 [[INS2]], 2
; CHECK: %5:fpr16 = CPYi16 [[INS3]], 3
%2:fpr(s16), %3:fpr(s16), %4:fpr(s16), %5:fpr(s16) = G_UNMERGE_VALUES %0(<4 x s16>)
%1:fpr(<4 x s16>) = G_BUILD_VECTOR %2(s16), %3(s16), %4(s16), %5(s16)
$d0 = COPY %1(<4 x s16>)
RET_ReallyLR implicit $d0
...
---
name: test_v8s16_unmerge
alignment: 4
legalized: true
regBankSelected: true
tracksRegLiveness: true
registers:
- { id: 0, class: fpr }
- { id: 1, class: fpr }
- { id: 2, class: fpr }
- { id: 3, class: fpr }
- { id: 4, class: fpr }
- { id: 5, class: fpr }
- { id: 6, class: fpr }
- { id: 7, class: fpr }
- { id: 8, class: fpr }
- { id: 9, class: fpr }
body: |
bb.1 (%ir-block.0):
liveins: $q0
; CHECK-LABEL: name: test_v8s16_unmerge
%0:fpr(<8 x s16>) = COPY $q0
; Since 8 * 16 = 128, we can just directly copy.
; CHECK: %2:fpr16 = COPY %0.hsub
; CHECK: %3:fpr16 = CPYi16 %0, 1
; CHECK: %4:fpr16 = CPYi16 %0, 2
; CHECK: %5:fpr16 = CPYi16 %0, 3
; CHECK: %6:fpr16 = CPYi16 %0, 4
; CHECK: %7:fpr16 = CPYi16 %0, 5
; CHECK: %8:fpr16 = CPYi16 %0, 6
; CHECK: %9:fpr16 = CPYi16 %0, 7
%2:fpr(s16), %3:fpr(s16), %4:fpr(s16), %5:fpr(s16), %6:fpr(s16), %7:fpr(s16), %8:fpr(s16), %9:fpr(s16) = G_UNMERGE_VALUES %0(<8 x s16>)
%1:fpr(<8 x s16>) = G_BUILD_VECTOR %2:fpr(s16), %3:fpr(s16), %4:fpr(s16), %5:fpr(s16), %6:fpr(s16), %7:fpr(s16), %8:fpr(s16), %9:fpr(s16)
$q0 = COPY %1(<8 x s16>)
RET_ReallyLR implicit $q0
...
---
name: test_vecsplit_2v2s32_v4s32
alignment: 4
legalized: true
regBankSelected: true
tracksRegLiveness: true
body: |
bb.1 (%ir-block.0):
liveins: $q0
; CHECK-LABEL: name: test_vecsplit_2v2s32_v4s32
; CHECK: liveins: $q0
; CHECK: [[COPY:%[0-9]+]]:fpr128 = COPY $q0
; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY [[COPY]].dsub
; CHECK: [[CPYi64_:%[0-9]+]]:fpr64 = CPYi64 [[COPY]], 1
; CHECK: $d0 = COPY [[COPY1]]
; CHECK: $d1 = COPY [[CPYi64_]]
; CHECK: RET_ReallyLR implicit $d0
%0:fpr(<4 x s32>) = COPY $q0
%1:fpr(<2 x s32>), %2:fpr(<2 x s32>) = G_UNMERGE_VALUES %0(<4 x s32>)
$d0 = COPY %1(<2 x s32>)
$d1 = COPY %2(<2 x s32>)
RET_ReallyLR implicit $d0
...
---
name: test_vecsplit_2v2s16_v4s16
alignment: 4
legalized: true
regBankSelected: true
tracksRegLiveness: true
body: |
bb.1 (%ir-block.0):
liveins: $d0
; CHECK-LABEL: name: test_vecsplit_2v2s16_v4s16
; CHECK: liveins: $d0
; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY [[COPY]].ssub
; CHECK: [[DEF:%[0-9]+]]:fpr128 = IMPLICIT_DEF
; CHECK: [[INSERT_SUBREG:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF]], [[COPY]], %subreg.dsub
; CHECK: [[CPYi32_:%[0-9]+]]:fpr32 = CPYi32 [[INSERT_SUBREG]], 1
; CHECK: $s0 = COPY [[COPY1]]
; CHECK: $s1 = COPY [[CPYi32_]]
; CHECK: RET_ReallyLR implicit $s0
%0:fpr(<4 x s16>) = COPY $d0
%1:fpr(<2 x s16>), %2:fpr(<2 x s16>) = G_UNMERGE_VALUES %0(<4 x s16>)
$s0 = COPY %1(<2 x s16>)
$s1 = COPY %2(<2 x s16>)
RET_ReallyLR implicit $s0
...
---
name: test_s128
alignment: 4
legalized: true
regBankSelected: true
tracksRegLiveness: true
body: |
bb.1:
liveins: $q0
%0:fpr(s128) = COPY $q0
%1:fpr(s64), %2:fpr(s64) = G_UNMERGE_VALUES %0(s128)
$d0 = COPY %1(s64)
$d1 = COPY %2(s64)
RET_ReallyLR implicit $d0, implicit $d1
...
|