• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mcpu=pwr8 -mtriple=powerpc64-unknown-linux-gnu -mattr=+power8-vector < %s | FileCheck %s
2; RUN: llc -mcpu=pwr7 -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck -check-prefix=CHECK-PWR7 %s
3
4define void @VPKUDUM_unary(<2 x i64>* %A) {
5entry:
6        %tmp = load <2 x i64>, <2 x i64>* %A
7        %tmp2 = bitcast <2 x i64> %tmp to <4 x i32>
8        %tmp3 = extractelement <4 x i32> %tmp2, i32 1
9        %tmp4 = extractelement <4 x i32> %tmp2, i32 3
10        %tmp5 = insertelement <4 x i32> undef, i32 %tmp3, i32 0
11        %tmp6 = insertelement <4 x i32> %tmp5, i32 %tmp4, i32 1
12        %tmp7 = insertelement <4 x i32> %tmp6, i32 %tmp3, i32 2
13        %tmp8 = insertelement <4 x i32> %tmp7, i32 %tmp4, i32 3
14        %tmp9 = bitcast <4 x i32> %tmp8 to <2 x i64>
15        store <2 x i64> %tmp9, <2 x i64>* %A
16        ret void
17}
18
19; CHECK-LABEL: @VPKUDUM_unary
20; CHECK-NOT:   vperm
21; CHECK-NOT:   vmrglw
22; CHECK-NOT:   vmrghw
23; CHECK:       vpkudum
24; CHECK-PWR7:  vmrglw
25; CHECK-PWR7:  vmrghw
26; CHECK-PWR7:  vmrglw
27
28define void @VPKUDUM(<2 x i64>* %A, <2 x i64>* %B) {
29entry:
30        %tmp = load <2 x i64>, <2 x i64>* %A
31        %tmp2 = bitcast <2 x i64> %tmp to <4 x i32>
32        %tmp3 = load <2 x i64>, <2 x i64>* %B
33        %tmp4 = bitcast <2 x i64> %tmp3 to <4 x i32>
34        %tmp5 = extractelement <4 x i32> %tmp2, i32 1
35        %tmp6 = extractelement <4 x i32> %tmp2, i32 3
36        %tmp7 = extractelement <4 x i32> %tmp4, i32 1
37        %tmp8 = extractelement <4 x i32> %tmp4, i32 3
38        %tmp9 = insertelement <4 x i32> undef, i32 %tmp5, i32 0
39        %tmp10 = insertelement <4 x i32> %tmp9, i32 %tmp6, i32 1
40        %tmp11 = insertelement <4 x i32> %tmp10, i32 %tmp7, i32 2
41        %tmp12 = insertelement <4 x i32> %tmp11, i32 %tmp8, i32 3
42        %tmp13 = bitcast <4 x i32> %tmp12 to <2 x i64>
43        store <2 x i64> %tmp13, <2 x i64>* %A
44        ret void
45}
46
47; CHECK-LABEL: @VPKUDUM
48; CHECK-NOT:   vperm
49; CHECK-NOT:   vmrglw
50; CHECK-NOT:   vmrghw
51; CHECK:       vpkudum
52; CHECK-PWR7:  vmrglw
53; CHECK-PWR7:  vmrghw
54; CHECK-PWR7:  vmrglw
55