1; RUN: llc -march=hexagon < %s | FileCheck %s
2
3; CHECK-LABEL: test_00:
4; CHECK: r0 = swiz(r0)
5define <4 x i8> @test_00(<4 x i8> %a0) {
6  %p = shufflevector <4 x i8> %a0, <4 x i8> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
7  ret <4 x i8> %p
8}
9
10; CHECK-LABEL: test_01:
11; CHECK: r0 = swiz(r0)
12define <4 x i8> @test_01(<4 x i8> %a0) {
13  %p = shufflevector <4 x i8> %a0, <4 x i8> undef, <4 x i32> <i32 undef, i32 2, i32 1, i32 0>
14  ret <4 x i8> %p
15}
16
17; CHECK-LABEL: test_02:
18; CHECK: r0 = swiz(r0)
19define <4 x i8> @test_02(<4 x i8> %a0) {
20  %p = shufflevector <4 x i8> %a0, <4 x i8> undef, <4 x i32> <i32 3, i32 undef, i32 1, i32 0>
21  ret <4 x i8> %p
22}
23
24; CHECK-LABEL: test_03:
25; CHECK: r0 = swiz(r0)
26define <4 x i8> @test_03(<4 x i8> %a0) {
27  %p = shufflevector <4 x i8> %a0, <4 x i8> undef, <4 x i32> <i32 3, i32 2, i32 undef, i32 undef>
28  ret <4 x i8> %p
29}
30
31; CHECK-LABEL: test_10:
32; CHECK: r0 = vtrunehb(r1:0)
33define <4 x i8> @test_10(<4 x i8> %a0, <4 x i8> %a1) {
34  %p = shufflevector <4 x i8> %a0, <4 x i8> %a1, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
35  ret <4 x i8> %p
36}
37
38; CHECK-LABEL: test_11:
39; CHECK: r0 = vtrunehb(r1:0)
40define <4 x i8> @test_11(<4 x i8> %a0, <4 x i8> %a1) {
41  %p = shufflevector <4 x i8> %a0, <4 x i8> %a1, <4 x i32> <i32 undef, i32 2, i32 4, i32 undef>
42  ret <4 x i8> %p
43}
44
45; CHECK-LABEL: test_12:
46; CHECK: r0 = vtrunehb(r1:0)
47define <4 x i8> @test_12(<4 x i8> %a0, <4 x i8> %a1) {
48  %p = shufflevector <4 x i8> %a0, <4 x i8> %a1, <4 x i32> <i32 0, i32 undef, i32 4, i32 6>
49  ret <4 x i8> %p
50}
51
52; CHECK-LABEL: test_13:
53; CHECK: r0 = vtrunehb(r1:0)
54define <4 x i8> @test_13(<4 x i8> %a0, <4 x i8> %a1) {
55  %p = shufflevector <4 x i8> %a0, <4 x i8> %a1, <4 x i32> <i32 0, i32 2, i32 undef, i32 undef>
56  ret <4 x i8> %p
57}
58
59; CHECK-LABEL: test_20:
60; CHECK: r0 = vtrunohb(r1:0)
61define <4 x i8> @test_20(<4 x i8> %a0, <4 x i8> %a1) {
62  %p = shufflevector <4 x i8> %a0, <4 x i8> %a1, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
63  ret <4 x i8> %p
64}
65
66; CHECK-LABEL: test_21:
67; CHECK: r0 = vtrunohb(r1:0)
68define <4 x i8> @test_21(<4 x i8> %a0, <4 x i8> %a1) {
69  %p = shufflevector <4 x i8> %a0, <4 x i8> %a1, <4 x i32> <i32 undef, i32 3, i32 5, i32 7>
70  ret <4 x i8> %p
71}
72
73; CHECK-LABEL: test_22:
74; CHECK: r0 = vtrunohb(r1:0)
75define <4 x i8> @test_22(<4 x i8> %a0, <4 x i8> %a1) {
76  %p = shufflevector <4 x i8> %a0, <4 x i8> %a1, <4 x i32> <i32 undef, i32 undef, i32 5, i32 7>
77  ret <4 x i8> %p
78}
79
80; CHECK-LABEL: test_23:
81; CHECK: r0 = vtrunohb(r1:0)
82define <4 x i8> @test_23(<4 x i8> %a0, <4 x i8> %a1) {
83  %p = shufflevector <4 x i8> %a0, <4 x i8> %a1, <4 x i32> <i32 1, i32 3, i32 5, i32 undef>
84  ret <4 x i8> %p
85}
86
87