|
11 | 11 | ret <4 x float> %a
|
12 | 12 | }
|
13 | 13 |
|
| 14 | + define <2 x half> @test_v2s16_unmerge(<2 x half> %a) { |
| 15 | + ret <2 x half> %a |
| 16 | + } |
| 17 | + |
14 | 18 | define <4 x half> @test_v4s16_unmerge(<4 x half> %a) {
|
15 | 19 | ret <4 x half> %a
|
16 | 20 | }
|
@@ -87,6 +91,49 @@ body: |
|
87 | 91 | RET_ReallyLR implicit $q0
|
88 | 92 | ...
|
89 | 93 | ---
|
| 94 | +name: test_v2s16_unmerge |
| 95 | +legalized: true |
| 96 | +regBankSelected: true |
| 97 | +tracksRegLiveness: true |
| 98 | +registers: |
| 99 | + - { id: 0, class: fpr } |
| 100 | + - { id: 1, class: fpr } |
| 101 | + - { id: 2, class: fpr } |
| 102 | + - { id: 3, class: fpr } |
| 103 | + - { id: 4, class: fpr } |
| 104 | + - { id: 5, class: fpr } |
| 105 | +body: | |
| 106 | + bb.1 (%ir-block.0): |
| 107 | + liveins: $s0 |
| 108 | + ; CHECK-LABEL: name: test_v2s16_unmerge |
| 109 | +
|
| 110 | + ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0 |
| 111 | + %0:fpr(<2 x s16>) = COPY $s0 |
| 112 | +
|
| 113 | + ; Since 2 * 16 != 128, we need to widen using implicit defs. |
| 114 | + ; Note that we expect to reuse one of the INSERT_SUBREG results, as CPYi16 |
| 115 | + ; expects a lane > 0. |
| 116 | + ; CHECK: [[DEF:%[0-9]+]]:fpr128 = IMPLICIT_DEF |
| 117 | + ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF]], [[COPY]], %subreg.ssub |
| 118 | + ; CHECK: [[COPY1:%[0-9]+]]:fpr16 = COPY [[INSERT_SUBREG]].hsub |
| 119 | + ; CHECK: [[CPYi16_:%[0-9]+]]:fpr16 = CPYi16 [[INSERT_SUBREG]], 1 |
| 120 | + %2:fpr(s16), %3:fpr(s16) = G_UNMERGE_VALUES %0(<2 x s16>) |
| 121 | +
|
| 122 | + ; CHECK: [[DEF1:%[0-9]+]]:fpr128 = IMPLICIT_DEF |
| 123 | + ; CHECK: [[INSERT_SUBREG1:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF1]], [[COPY1]], %subreg.hsub |
| 124 | + ; CHECK: [[DEF2:%[0-9]+]]:fpr128 = IMPLICIT_DEF |
| 125 | + ; CHECK: [[INSERT_SUBREG2:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF2]], [[CPYi16_]], %subreg.hsub |
| 126 | + ; CHECK: [[INSvi16lane:%[0-9]+]]:fpr128 = INSvi16lane [[INSERT_SUBREG1]], 1, [[INSERT_SUBREG2]], 0 |
| 127 | + ; CHECK: [[COPY2:%[0-9]+]]:fpr32 = COPY [[INSvi16lane]].ssub |
| 128 | + %1:fpr(<2 x s16>) = G_BUILD_VECTOR %2(s16), %3(s16) |
| 129 | +
|
| 130 | + ; CHECK: $s0 = COPY [[COPY2]] |
| 131 | + $s0 = COPY %1(<2 x s16>) |
| 132 | +
|
| 133 | + ; CHECK: RET_ReallyLR implicit $s0 |
| 134 | + RET_ReallyLR implicit $s0 |
| 135 | +... |
| 136 | +--- |
90 | 137 | name: test_v4s16_unmerge
|
91 | 138 | alignment: 4
|
92 | 139 | legalized: true
|
|
0 commit comments