• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test inserting a truncated value into a vector element
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | \
4; RUN:   FileCheck -check-prefix=CHECK-CODE %s
5; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | \
6; RUN:   FileCheck -check-prefix=CHECK-VECTOR %s
7
8define <4 x i32> @f1(<4 x i32> %x, i64 %y) {
9; CHECK-CODE-LABEL: f1:
10; CHECK-CODE-DAG: vlvgf [[ELT:%v[0-9]+]], %r2, 0
11; CHECK-CODE-DAG: larl [[REG:%r[0-5]]],
12; CHECK-CODE-DAG: vl [[MASK:%v[0-9]+]], 0([[REG]])
13; CHECK-CODE: vperm %v24, %v24, [[ELT]], [[MASK]]
14; CHECK-CODE: br %r14
15
16; CHECK-VECTOR: .byte 12
17; CHECK-VECTOR-NEXT: .byte 13
18; CHECK-VECTOR-NEXT: .byte 14
19; CHECK-VECTOR-NEXT: .byte 15
20; CHECK-VECTOR-NEXT: .byte 8
21; CHECK-VECTOR-NEXT: .byte 9
22; CHECK-VECTOR-NEXT: .byte 10
23; CHECK-VECTOR-NEXT: .byte 11
24; CHECK-VECTOR-NEXT: .byte 4
25; CHECK-VECTOR-NEXT: .byte 5
26; CHECK-VECTOR-NEXT: .byte 6
27; CHECK-VECTOR-NEXT: .byte 7
28; CHECK-VECTOR-NEXT: .byte 16
29; CHECK-VECTOR-NEXT: .byte 17
30; CHECK-VECTOR-NEXT: .byte 18
31; CHECK-VECTOR-NEXT: .byte 19
32
33  %elt0 = extractelement <4 x i32> %x, i32 3
34  %elt1 = extractelement <4 x i32> %x, i32 2
35  %elt2 = extractelement <4 x i32> %x, i32 1
36  %elt3 = trunc i64 %y to i32
37  %vec0 = insertelement <4 x i32> undef, i32 %elt0, i32 0
38  %vec1 = insertelement <4 x i32> %vec0, i32 %elt1, i32 1
39  %vec2 = insertelement <4 x i32> %vec1, i32 %elt2, i32 2
40  %vec3 = insertelement <4 x i32> %vec2, i32 %elt3, i32 3
41  ret <4 x i32> %vec3
42}
43
44