1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/test/CodeGen/SystemZ/vec-move-01.ll
Ulrich Weigand 096deccae0 [SystemZ] Handle sub-128 vectors
The ABI allows sub-128 vectors to be passed and returned in registers,
with the vector occupying the upper part of a register.  We therefore
want to legalize those types by widening the vector rather than promoting
the elements.

The patch includes some simple tests for sub-128 vectors and also tests
that we can recognize various pack sequences, some of which use sub-128
vectors as temporary results.  One of these forms is based on the pack
sequences generated by llvmpipe when no intrinsics are used.

Signed unpacks are recognized as BUILD_VECTORs whose elements are
individually sign-extended.  Unsigned unpacks can have the equivalent
form with zero extension, but they also occur as shuffles in which some
elements are zero.

Based on a patch by Richard Sandiford.

llvm-svn: 236525
2015-05-05 19:29:21 +00:00

108 lines
2.2 KiB
LLVM

; Test vector register moves.
;
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
; Test v16i8 moves.
define <16 x i8> @f1(<16 x i8> %val1, <16 x i8> %val2) {
; CHECK-LABEL: f1:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <16 x i8> %val2
}
; Test v8i16 moves.
define <8 x i16> @f2(<8 x i16> %val1, <8 x i16> %val2) {
; CHECK-LABEL: f2:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <8 x i16> %val2
}
; Test v4i32 moves.
define <4 x i32> @f3(<4 x i32> %val1, <4 x i32> %val2) {
; CHECK-LABEL: f3:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <4 x i32> %val2
}
; Test v2i64 moves.
define <2 x i64> @f4(<2 x i64> %val1, <2 x i64> %val2) {
; CHECK-LABEL: f4:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <2 x i64> %val2
}
; Test v4f32 moves.
define <4 x float> @f5(<4 x float> %val1, <4 x float> %val2) {
; CHECK-LABEL: f5:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <4 x float> %val2
}
; Test v2f64 moves.
define <2 x double> @f6(<2 x double> %val1, <2 x double> %val2) {
; CHECK-LABEL: f6:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <2 x double> %val2
}
; Test v2i8 moves.
define <2 x i8> @f7(<2 x i8> %val1, <2 x i8> %val2) {
; CHECK-LABEL: f7:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <2 x i8> %val2
}
; Test v4i8 moves.
define <4 x i8> @f8(<4 x i8> %val1, <4 x i8> %val2) {
; CHECK-LABEL: f8:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <4 x i8> %val2
}
; Test v8i8 moves.
define <8 x i8> @f9(<8 x i8> %val1, <8 x i8> %val2) {
; CHECK-LABEL: f9:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <8 x i8> %val2
}
; Test v2i16 moves.
define <2 x i16> @f10(<2 x i16> %val1, <2 x i16> %val2) {
; CHECK-LABEL: f10:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <2 x i16> %val2
}
; Test v4i16 moves.
define <4 x i16> @f11(<4 x i16> %val1, <4 x i16> %val2) {
; CHECK-LABEL: f11:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <4 x i16> %val2
}
; Test v2i32 moves.
define <2 x i32> @f12(<2 x i32> %val1, <2 x i32> %val2) {
; CHECK-LABEL: f12:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <2 x i32> %val2
}
; Test v2f32 moves.
define <2 x float> @f13(<2 x float> %val1, <2 x float> %val2) {
; CHECK-LABEL: f13:
; CHECK: vlr %v24, %v26
; CHECK: br %r14
ret <2 x float> %val2
}