1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64-unknown-linux-gnu -mattr=+power8-vector < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck -check-prefix=CHECK-PWR7 %s
5 define void @VPKUDUM_unary(<2 x i64>* %A) {
6 ; CHECK-LABEL: VPKUDUM_unary:
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: lxvw4x 34, 0, 3
9 ; CHECK-NEXT: vpkudum 2, 2, 2
10 ; CHECK-NEXT: stxvw4x 34, 0, 3
13 ; CHECK-PWR7-LABEL: VPKUDUM_unary:
14 ; CHECK-PWR7: # %bb.0: # %entry
15 ; CHECK-PWR7-NEXT: lxvw4x 34, 0, 3
16 ; CHECK-PWR7-NEXT: vmrglw 3, 2, 2
17 ; CHECK-PWR7-NEXT: vmrghw 2, 2, 2
18 ; CHECK-PWR7-NEXT: vmrglw 2, 2, 3
19 ; CHECK-PWR7-NEXT: stxvw4x 34, 0, 3
20 ; CHECK-PWR7-NEXT: blr
22 %tmp = load <2 x i64>, <2 x i64>* %A
23 %tmp2 = bitcast <2 x i64> %tmp to <4 x i32>
24 %tmp3 = extractelement <4 x i32> %tmp2, i32 1
25 %tmp4 = extractelement <4 x i32> %tmp2, i32 3
26 %tmp5 = insertelement <4 x i32> undef, i32 %tmp3, i32 0
27 %tmp6 = insertelement <4 x i32> %tmp5, i32 %tmp4, i32 1
28 %tmp7 = insertelement <4 x i32> %tmp6, i32 %tmp3, i32 2
29 %tmp8 = insertelement <4 x i32> %tmp7, i32 %tmp4, i32 3
30 %tmp9 = bitcast <4 x i32> %tmp8 to <2 x i64>
31 store <2 x i64> %tmp9, <2 x i64>* %A
35 define void @VPKUDUM(<2 x i64>* %A, <2 x i64>* %B) {
36 ; CHECK-LABEL: VPKUDUM:
37 ; CHECK: # %bb.0: # %entry
38 ; CHECK-NEXT: lxvw4x 34, 0, 3
39 ; CHECK-NEXT: lxvw4x 35, 0, 4
40 ; CHECK-NEXT: vpkudum 2, 2, 3
41 ; CHECK-NEXT: stxvw4x 34, 0, 3
44 ; CHECK-PWR7-LABEL: VPKUDUM:
45 ; CHECK-PWR7: # %bb.0: # %entry
46 ; CHECK-PWR7-NEXT: lxvw4x 34, 0, 3
47 ; CHECK-PWR7-NEXT: lxvw4x 35, 0, 4
48 ; CHECK-PWR7-NEXT: vmrglw 4, 2, 3
49 ; CHECK-PWR7-NEXT: vmrghw 2, 2, 3
50 ; CHECK-PWR7-NEXT: vmrglw 2, 2, 4
51 ; CHECK-PWR7-NEXT: stxvw4x 34, 0, 3
52 ; CHECK-PWR7-NEXT: blr
54 %tmp = load <2 x i64>, <2 x i64>* %A
55 %tmp2 = bitcast <2 x i64> %tmp to <4 x i32>
56 %tmp3 = load <2 x i64>, <2 x i64>* %B
57 %tmp4 = bitcast <2 x i64> %tmp3 to <4 x i32>
58 %tmp5 = extractelement <4 x i32> %tmp2, i32 1
59 %tmp6 = extractelement <4 x i32> %tmp2, i32 3
60 %tmp7 = extractelement <4 x i32> %tmp4, i32 1
61 %tmp8 = extractelement <4 x i32> %tmp4, i32 3
62 %tmp9 = insertelement <4 x i32> undef, i32 %tmp5, i32 0
63 %tmp10 = insertelement <4 x i32> %tmp9, i32 %tmp6, i32 1
64 %tmp11 = insertelement <4 x i32> %tmp10, i32 %tmp7, i32 2
65 %tmp12 = insertelement <4 x i32> %tmp11, i32 %tmp8, i32 3
66 %tmp13 = bitcast <4 x i32> %tmp12 to <2 x i64>
67 store <2 x i64> %tmp13, <2 x i64>* %A