return false;
}
} else {
- // A scalar extend.
- CurVReg =
- MIRBuilder.buildInstr(ExtendOp, {NewLLT}, {CurVReg}).getReg(0);
+ // If the split EVT was a <1 x T> vector, and NewVT is T, then we
+ // don't have to do anything since we don't distinguish between the
+ // two.
+ if (NewLLT != MRI.getType(CurVReg)) {
+ // A scalar extend.
+ CurVReg = MIRBuilder.buildInstr(ExtendOp, {NewLLT}, {CurVReg})
+ .getReg(0);
+ }
}
}
}
ret i24 %res
}
+
+define <1 x half> @test_v1s16(<1 x float> %x) {
+ ; CHECK-LABEL: name: test_v1s16
+ ; CHECK: bb.1 (%ir-block.0):
+ ; CHECK: liveins: $d0
+ ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
+ ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
+ ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[UV]](s32)
+ ; CHECK: $h0 = COPY [[FPTRUNC]](s16)
+ ; CHECK: RET_ReallyLR implicit $h0
+ %tmp = fptrunc <1 x float> %x to <1 x half>
+ ret <1 x half> %tmp
+}