1; RUN: llc -march=hexagon < %s | FileCheck %s
2
3; CHECK-LABEL: test_00:
4; CHECK-DAG: r[[REG00:[0-9]+]] = swiz(r0)
5; CHECK-DAG: r[[REG01:[0-9]+]] = swiz(r1)
6; CHECK: r1:0 = combine(r[[REG00]],r[[REG01]])
7define <8 x i8> @test_00(<8 x i8> %a0) {
8  %p = shufflevector <8 x i8> %a0, <8 x i8> undef, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
9  ret <8 x i8> %p
10}
11
12; CHECK-LABEL: test_10:
13; CHECK: r1:0 = packhl(r1,r0)
14define <4 x i16> @test_10(<4 x i16> %a0) {
15  %p = shufflevector <4 x i16> %a0, <4 x i16> undef, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
16  ret <4 x i16> %p
17}
18
19; CHECK-LABEL: test_11:
20; CHECK: r1:0 = packhl(r1,r0)
21define <4 x i16> @test_11(<4 x i16> %a0) {
22  %p = shufflevector <4 x i16> undef, <4 x i16> %a0, <4 x i32> <i32 4, i32 6, i32 5, i32 7>
23  ret <4 x i16> %p
24}
25
26; CHECK-LABEL: test_20:
27; CHECK: r1:0 = shuffeh(r3:2,r1:0)
28define <4 x i16> @test_20(<4 x i16> %a0, <4 x i16> %a1) {
29  %p = shufflevector <4 x i16> %a0, <4 x i16> %a1, <4 x i32> <i32 0, i32 4, i32 2, i32 6>
30  ret <4 x i16> %p
31}
32
33; CHECK-LABEL: test_30:
34; CHECK: r1:0 = shuffoh(r3:2,r1:0)
35define <4 x i16> @test_30(<4 x i16> %a0, <4 x i16> %a1) {
36  %p = shufflevector <4 x i16> %a0, <4 x i16> %a1, <4 x i32> <i32 1, i32 5, i32 3, i32 7>
37  ret <4 x i16> %p
38}
39
40; CHECK-LABEL: test_40:
41; CHECK: r1:0 = vtrunewh(r3:2,r1:0)
42define <4 x i16> @test_40(<4 x i16> %a0, <4 x i16> %a1) {
43  %p = shufflevector <4 x i16> %a0, <4 x i16> %a1, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
44  ret <4 x i16> %p
45}
46
47; CHECK-LABEL: test_50:
48; CHECK: r1:0 = vtrunowh(r3:2,r1:0)
49define <4 x i16> @test_50(<4 x i16> %a0, <4 x i16> %a1) {
50  %p = shufflevector <4 x i16> %a0, <4 x i16> %a1, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
51  ret <4 x i16> %p
52}
53
54; CHECK-LABEL: test_60:
55; r1:0 = shuffeb(r3:2,r1:0)
56define <8 x i8> @test_60(<8 x i8> %a0, <8 x i8> %a1) {
57  %p = shufflevector <8 x i8> %a0, <8 x i8> %a1, <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 4, i32 12, i32 6, i32 14>
58  ret <8 x i8> %p
59}
60
61; CHECK-LABEL: test_70:
62; r1:0 = shuffob(r3:2,r1:0)
63define <8 x i8> @test_70(<8 x i8> %a0, <8 x i8> %a1) {
64  %p = shufflevector <8 x i8> %a0, <8 x i8> %a1, <8 x i32> <i32 1, i32 9, i32 3, i32 11, i32 5, i32 13, i32 7, i32 15>
65  ret <8 x i8> %p
66}
67