1 ; RUN: llc -verify-machineinstrs -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
2 ; RUN: -mcpu=pwr9 -mtriple=powerpc64 < %s | FileCheck %s
3 define dso_local <16 x i8> @ConvertExtractedMaskBitsToVect(<16 x i8> noundef %0) local_unnamed_addr #0 {
5 ; CHECK-NEXT: .byte 23 # 0x17
6 ; CHECK-NEXT: .byte 23 # 0x17
7 ; CHECK-NEXT: .byte 23 # 0x17
8 ; CHECK-NEXT: .byte 23 # 0x17
9 ; CHECK-NEXT: .byte 23 # 0x17
10 ; CHECK-NEXT: .byte 23 # 0x17
11 ; CHECK-NEXT: .byte 23 # 0x17
12 ; CHECK-NEXT: .byte 23 # 0x17
13 ; CHECK-NEXT: .byte 0 # 0x0
14 ; CHECK-NEXT: .byte 0 # 0x0
15 ; CHECK-NEXT: .byte 0 # 0x0
16 ; CHECK-NEXT: .byte 0 # 0x0
17 ; CHECK-NEXT: .byte 0 # 0x0
18 ; CHECK-NEXT: .byte 0 # 0x0
19 ; CHECK-NEXT: .byte 0 # 0x0
20 ; CHECK-NEXT: .byte 0 # 0x0
21 ; CHECK-LABEL: ConvertExtractedMaskBitsToVect:
23 ; CHECK-NEXT: addis r3, r2, .LCPI0_0@toc@ha
24 ; CHECK-NEXT: xxlxor v3, v3, v3
25 ; CHECK-NEXT: addi r3, r3, .LCPI0_0@toc@l
26 ; CHECK-NEXT: lxv vs0, 0(r3)
27 ; CHECK-NEXT: addis r3, r2, .LCPI0_1@toc@ha
28 ; CHECK-NEXT: addi r3, r3, .LCPI0_1@toc@l
29 ; CHECK-NEXT: xxperm v2, v3, vs0
30 ; CHECK-NEXT: lxv vs0, 0(r3)
31 ; CHECK-NEXT: xxland v2, v2, vs0
32 ; CHECK-NEXT: vcmpequb v2, v2, v3
33 ; CHECK-NEXT: xxlnor v2, v2, v2
35 %a4 = extractelement <16 x i8> %0, i64 7
36 %a5 = zext i8 %a4 to i16
37 %a6 = insertelement <8 x i16> poison, i16 %a5, i64 0
38 %a7 = bitcast <8 x i16> %a6 to <16 x i8>
39 %a8 = shufflevector <16 x i8> %a7, <16 x i8> undef, <16 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
40 %a9 = and <16 x i8> %a8, <i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128, i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128>
41 %a10 = icmp eq <16 x i8> %a9, <i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128, i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128>
42 %a11 = sext <16 x i1> %a10 to <16 x i8>
46 define dso_local <16 x i8> @ConvertExtractedMaskBitsToVect2(<16 x i8> noundef %0) local_unnamed_addr #0 {
48 ; CHECK-NEXT: .byte 23 # 0x17
49 ; CHECK-NEXT: .byte 23 # 0x17
50 ; CHECK-NEXT: .byte 23 # 0x17
51 ; CHECK-NEXT: .byte 23 # 0x17
52 ; CHECK-NEXT: .byte 23 # 0x17
53 ; CHECK-NEXT: .byte 23 # 0x17
54 ; CHECK-NEXT: .byte 23 # 0x17
55 ; CHECK-NEXT: .byte 23 # 0x17
56 ; CHECK-NEXT: .byte 0 # 0x0
57 ; CHECK-NEXT: .byte 0 # 0x0
58 ; CHECK-NEXT: .byte 0 # 0x0
59 ; CHECK-NEXT: .byte 0 # 0x0
60 ; CHECK-NEXT: .byte 0 # 0x0
61 ; CHECK-NEXT: .byte 0 # 0x0
62 ; CHECK-NEXT: .byte 0 # 0x0
63 ; CHECK-NEXT: .byte 0 # 0x0
64 ; CHECK-LABEL: ConvertExtractedMaskBitsToVect2:
66 ; CHECK-NEXT: addis r3, r2, .LCPI1_0@toc@ha
67 ; CHECK-NEXT: xxlxor v3, v3, v3
68 ; CHECK-NEXT: addi r3, r3, .LCPI1_0@toc@l
69 ; CHECK-NEXT: lxv vs0, 0(r3)
70 ; CHECK-NEXT: addis r3, r2, .LCPI1_1@toc@ha
71 ; CHECK-NEXT: addi r3, r3, .LCPI1_1@toc@l
72 ; CHECK-NEXT: xxperm v2, v3, vs0
73 ; CHECK-NEXT: lxv vs0, 0(r3)
74 ; CHECK-NEXT: xxland v2, v2, vs0
75 ; CHECK-NEXT: vcmpequb v2, v2, v3
76 ; CHECK-NEXT: xxlnor v2, v2, v2
78 %a4 = extractelement <16 x i8> %0, i64 7
79 %a5 = zext i8 %a4 to i32
80 %a6 = insertelement <4 x i32> poison, i32 %a5, i64 0
81 %a7 = bitcast <4 x i32> %a6 to <16 x i8>
82 %a8 = shufflevector <16 x i8> %a7, <16 x i8> undef, <16 x i32> <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
83 %a9 = and <16 x i8> %a8, <i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128, i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128>
84 %a10 = icmp eq <16 x i8> %a9, <i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128, i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128>
85 %a11 = sext <16 x i1> %a10 to <16 x i8>
89 define dso_local <16 x i8> @ConvertExtractedMaskBitsToVect3(<8 x i16> noundef %0) local_unnamed_addr #0 {
91 ; CHECK-NEXT: .byte 22 # 0x16
92 ; CHECK-NEXT: .byte 23 # 0x17
93 ; CHECK-NEXT: .byte 22 # 0x16
94 ; CHECK-NEXT: .byte 23 # 0x17
95 ; CHECK-NEXT: .byte 22 # 0x16
96 ; CHECK-NEXT: .byte 23 # 0x17
97 ; CHECK-NEXT: .byte 22 # 0x16
98 ; CHECK-NEXT: .byte 23 # 0x17
99 ; CHECK-NEXT: .byte 0 # 0x0
100 ; CHECK-NEXT: .byte 0 # 0x0
101 ; CHECK-NEXT: .byte 0 # 0x0
102 ; CHECK-NEXT: .byte 0 # 0x0
103 ; CHECK-NEXT: .byte 0 # 0x0
104 ; CHECK-NEXT: .byte 0 # 0x0
105 ; CHECK-NEXT: .byte 0 # 0x0
106 ; CHECK-NEXT: .byte 0 # 0x0
107 ; CHECK-LABEL: ConvertExtractedMaskBitsToVect3:
109 ; CHECK-NEXT: addis r3, r2, .LCPI2_0@toc@ha
110 ; CHECK-NEXT: xxlxor v3, v3, v3
111 ; CHECK-NEXT: addi r3, r3, .LCPI2_0@toc@l
112 ; CHECK-NEXT: lxv vs0, 0(r3)
113 ; CHECK-NEXT: addis r3, r2, .LCPI2_1@toc@ha
114 ; CHECK-NEXT: addi r3, r3, .LCPI2_1@toc@l
115 ; CHECK-NEXT: xxperm v2, v3, vs0
116 ; CHECK-NEXT: lxv vs0, 0(r3)
117 ; CHECK-NEXT: xxland v2, v2, vs0
118 ; CHECK-NEXT: vcmpequb v2, v2, v3
119 ; CHECK-NEXT: xxlnor v2, v2, v2
121 %a4 = extractelement <8 x i16> %0, i64 3
122 %a5 = zext i16 %a4 to i32
123 %a6 = insertelement <4 x i32> poison, i32 %a5, i64 0
124 %a7 = bitcast <4 x i32> %a6 to <16 x i8>
125 %a8 = shufflevector <16 x i8> %a7, <16 x i8> undef, <16 x i32> <i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
126 %a9 = and <16 x i8> %a8, <i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128, i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128>
127 %a10 = icmp eq <16 x i8> %a9, <i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128, i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128>
128 %a11 = sext <16 x i1> %a10 to <16 x i8>