1 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 < %s | \
2 ; RUN: FileCheck %s -check-prefix=CHECK-LE
3 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | \
4 ; RUN: FileCheck %s -check-prefix=CHECK-BE
6 ; Check for a vector merge instruction using two inputs
7 ; The shufflevector specifies the even elements, using big endian element
8 ; ordering. If run on a big endian machine, this should produce the vmrgew
9 ; instruction. If run on a little endian machine, this should produce the
10 ; vmrgow instruction. Note also that on little endian the input registers
12 define void @check_merge_even_xy(<16 x i8>* %A, <16 x i8>* %B) {
14 ; CHECK-LE-LABEL: @check_merge_even_xy
15 ; CHECK-BE-LABEL: @check_merge_even_xy
16 %tmp = load <16 x i8>, <16 x i8>* %A
17 %tmp2 = load <16 x i8>, <16 x i8>* %B
18 %tmp3 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp2,
19 <16 x i32> <i32 0, i32 1, i32 2, i32 3,
20 i32 16, i32 17, i32 18, i32 19,
21 i32 8, i32 9, i32 10, i32 11,
22 i32 24, i32 25, i32 26, i32 27>
23 ; CHECK-LE: vmrgow 2, 3, 2
24 ; CHECK-BE: vmrgew 2, 2, 3
25 store <16 x i8> %tmp3, <16 x i8>* %A
31 ; Check for a vector merge instruction using a single input.
32 ; The shufflevector specifies the even elements, using big endian element
33 ; ordering. If run on a big endian machine, this should produce the vmrgew
34 ; instruction. If run on a little endian machine, this should produce the
36 define void @check_merge_even_xx(<16 x i8>* %A) {
38 ; CHECK-LE-LABEL: @check_merge_even_xx
39 ; CHECK-BE-LABEL: @check_merge_even_xx
40 %tmp = load <16 x i8>, <16 x i8>* %A
41 %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp,
42 <16 x i32> <i32 0, i32 1, i32 2, i32 3,
43 i32 0, i32 1, i32 2, i32 3,
44 i32 8, i32 9, i32 10, i32 11,
45 i32 8, i32 9, i32 10, i32 11>
46 ; CHECK-LE: vmrgow 2, 2, 2
47 ; CHECK-BE: vmrgew 2, 2, 2
48 store <16 x i8> %tmp2, <16 x i8>* %A
54 ; Check for a vector merge instruction using two inputs.
55 ; The shufflevector specifies the odd elements, using big endian element
56 ; ordering. If run on a big endian machine, this should produce the vmrgow
57 ; instruction. If run on a little endian machine, this should produce the
58 ; vmrgew instruction. Note also that on little endian the input registers
60 define void @check_merge_odd_xy(<16 x i8>* %A, <16 x i8>* %B) {
62 ; CHECK-LE-LABEL: @check_merge_odd_xy
63 ; CHECK-BE-LABEL: @check_merge_odd_xy
64 %tmp = load <16 x i8>, <16 x i8>* %A
65 %tmp2 = load <16 x i8>, <16 x i8>* %B
66 %tmp3 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp2,
67 <16 x i32> <i32 4, i32 5, i32 6, i32 7,
68 i32 20, i32 21, i32 22, i32 23,
69 i32 12, i32 13, i32 14, i32 15,
70 i32 28, i32 29, i32 30, i32 31>
71 ; CHECK-LE: vmrgew 2, 3, 2
72 ; CHECK-BE: vmrgow 2, 2, 3
73 store <16 x i8> %tmp3, <16 x i8>* %A
79 ; Check for a vector merge instruction using a single input.
80 ; The shufflevector specifies the odd elements, using big endian element
81 ; ordering. If run on a big endian machine, this should produce the vmrgow
82 ; instruction. If run on a little endian machine, this should produce the
84 define void @check_merge_odd_xx(<16 x i8>* %A) {
86 ; CHECK-LE-LABEL: @check_merge_odd_xx
87 ; CHECK-BE-LABEL: @check_merge_odd_xx
88 %tmp = load <16 x i8>, <16 x i8>* %A
89 %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp,
90 <16 x i32> <i32 4, i32 5, i32 6, i32 7,
91 i32 4, i32 5, i32 6, i32 7,
92 i32 12, i32 13, i32 14, i32 15,
93 i32 12, i32 13, i32 14, i32 15>
94 ; CHECK-LE: vmrgew 2, 2, 2
95 ; CHECK-BE: vmrgow 2, 2, 2
96 store <16 x i8> %tmp2, <16 x i8>* %A