vector-extend-sign.ll
5.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
; RUN: -mcpu=pwr9 < %s | FileCheck %s --check-prefix=CHECK-P9
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
; RUN: -mcpu=pwr9 < %s | FileCheck %s --check-prefix=CHECK-P9
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
; RUN: -mcpu=pwr9 -mattr=-altivec < %s | FileCheck %s \
; RUN: --check-prefix=CHECK-P9-NOALTIVEC
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
; RUN: -mcpu=pwr8 < %s | FileCheck %s --check-prefix=CHECK-P8
define <4 x i32> @test_vextsh2w(<4 x i32> %m) {
; CHECK-P9-LABEL: test_vextsh2w:
; CHECK-P9: # %bb.0: # %entry
; CHECK-P9-NEXT: vextsh2w 2, 2
; CHECK-P9-NEXT: blr
;
; CHECK-P9-NOALTIVEC-LABEL: test_vextsh2w:
; CHECK-P9-NOALTIVEC: # %bb.0: # %entry
; CHECK-P9-NOALTIVEC-NEXT: extsh 6, 6
; CHECK-P9-NOALTIVEC-NEXT: extsh 5, 5
; CHECK-P9-NOALTIVEC-NEXT: extsh 4, 4
; CHECK-P9-NOALTIVEC-NEXT: extsh 3, 3
; CHECK-P9-NOALTIVEC-NEXT: blr
;
; CHECK-P8-LABEL: test_vextsh2w:
; CHECK-P8: # %bb.0: # %entry
; CHECK-P8-NEXT: vspltisw 3, 8
; CHECK-P8-NEXT: vadduwm 3, 3, 3
; CHECK-P8-NEXT: vslw 2, 2, 3
; CHECK-P8-NEXT: vsraw 2, 2, 3
; CHECK-P8-NEXT: blr
entry:
%shl = shl <4 x i32> %m, <i32 16, i32 16, i32 16, i32 16>
%shr = ashr exact <4 x i32> %shl, <i32 16, i32 16, i32 16, i32 16>
ret <4 x i32> %shr
}
define <4 x i32> @test_vextsb2w(<4 x i32> %m) {
; CHECK-P9-LABEL: test_vextsb2w:
; CHECK-P9: # %bb.0: # %entry
; CHECK-P9-NEXT: vextsb2w 2, 2
; CHECK-P9-NEXT: blr
;
; CHECK-P9-NOALTIVEC-LABEL: test_vextsb2w:
; CHECK-P9-NOALTIVEC: # %bb.0: # %entry
; CHECK-P9-NOALTIVEC-NEXT: extsb 6, 6
; CHECK-P9-NOALTIVEC-NEXT: extsb 5, 5
; CHECK-P9-NOALTIVEC-NEXT: extsb 4, 4
; CHECK-P9-NOALTIVEC-NEXT: extsb 3, 3
; CHECK-P9-NOALTIVEC-NEXT: blr
;
; CHECK-P8-LABEL: test_vextsb2w:
; CHECK-P8: # %bb.0: # %entry
; CHECK-P8-NEXT: vspltisw 3, 12
; CHECK-P8-NEXT: vadduwm 3, 3, 3
; CHECK-P8-NEXT: vslw 2, 2, 3
; CHECK-P8-NEXT: vsraw 2, 2, 3
; CHECK-P8-NEXT: blr
entry:
%shl = shl <4 x i32> %m, <i32 24, i32 24, i32 24, i32 24>
%shr = ashr exact <4 x i32> %shl, <i32 24, i32 24, i32 24, i32 24>
ret <4 x i32> %shr
}
define <2 x i64> @test_vextsb2d(<2 x i64> %m) {
; CHECK-P9-LABEL: test_vextsb2d:
; CHECK-P9: # %bb.0: # %entry
; CHECK-P9-NEXT: vextsb2d 2, 2
; CHECK-P9-NEXT: blr
;
; CHECK-P9-NOALTIVEC-LABEL: test_vextsb2d:
; CHECK-P9-NOALTIVEC: # %bb.0: # %entry
; CHECK-P9-NOALTIVEC-NEXT: extsb 3, 3
; CHECK-P9-NOALTIVEC-NEXT: extsb 4, 4
; CHECK-P9-NOALTIVEC-NEXT: blr
;
; CHECK-P8-LABEL: test_vextsb2d:
; CHECK-P8: # %bb.0: # %entry
; CHECK-P8-NEXT: addis 3, 2, .LCPI2_0@toc@ha
; CHECK-P8-NEXT: addi 3, 3, .LCPI2_0@toc@l
; CHECK-P8-NEXT: lxvd2x 0, 0, 3
; CHECK-P8-NEXT: xxswapd 35, 0
; CHECK-P8-NEXT: vsld 2, 2, 3
; CHECK-P8-NEXT: vsrad 2, 2, 3
; CHECK-P8-NEXT: blr
entry:
%shl = shl <2 x i64> %m, <i64 56, i64 56>
%shr = ashr exact <2 x i64> %shl, <i64 56, i64 56>
ret <2 x i64> %shr
}
define <2 x i64> @test_vextsh2d(<2 x i64> %m) {
; CHECK-P9-LABEL: test_vextsh2d:
; CHECK-P9: # %bb.0: # %entry
; CHECK-P9-NEXT: vextsh2d 2, 2
; CHECK-P9-NEXT: blr
;
; CHECK-P9-NOALTIVEC-LABEL: test_vextsh2d:
; CHECK-P9-NOALTIVEC: # %bb.0: # %entry
; CHECK-P9-NOALTIVEC-NEXT: extsh 3, 3
; CHECK-P9-NOALTIVEC-NEXT: extsh 4, 4
; CHECK-P9-NOALTIVEC-NEXT: blr
;
; CHECK-P8-LABEL: test_vextsh2d:
; CHECK-P8: # %bb.0: # %entry
; CHECK-P8-NEXT: addis 3, 2, .LCPI3_0@toc@ha
; CHECK-P8-NEXT: addi 3, 3, .LCPI3_0@toc@l
; CHECK-P8-NEXT: lxvd2x 0, 0, 3
; CHECK-P8-NEXT: xxswapd 35, 0
; CHECK-P8-NEXT: vsld 2, 2, 3
; CHECK-P8-NEXT: vsrad 2, 2, 3
; CHECK-P8-NEXT: blr
entry:
%shl = shl <2 x i64> %m, <i64 48, i64 48>
%shr = ashr exact <2 x i64> %shl, <i64 48, i64 48>
ret <2 x i64> %shr
}
define <2 x i64> @test_vextsw2d(<2 x i64> %m) {
; CHECK-P9-LABEL: test_vextsw2d:
; CHECK-P9: # %bb.0: # %entry
; CHECK-P9-NEXT: vextsw2d 2, 2
; CHECK-P9-NEXT: blr
;
; CHECK-P9-NOALTIVEC-LABEL: test_vextsw2d:
; CHECK-P9-NOALTIVEC: # %bb.0: # %entry
; CHECK-P9-NOALTIVEC-NEXT: extsw 3, 3
; CHECK-P9-NOALTIVEC-NEXT: extsw 4, 4
; CHECK-P9-NOALTIVEC-NEXT: blr
;
; CHECK-P8-LABEL: test_vextsw2d:
; CHECK-P8: # %bb.0: # %entry
; CHECK-P8-NEXT: addis 3, 2, .LCPI4_0@toc@ha
; CHECK-P8-NEXT: addi 3, 3, .LCPI4_0@toc@l
; CHECK-P8-NEXT: lxvd2x 0, 0, 3
; CHECK-P8-NEXT: xxswapd 35, 0
; CHECK-P8-NEXT: vsld 2, 2, 3
; CHECK-P8-NEXT: vsrad 2, 2, 3
; CHECK-P8-NEXT: blr
entry:
%shl = shl <2 x i64> %m, <i64 32, i64 32>
%shr = ashr exact <2 x i64> %shl, <i64 32, i64 32>
ret <2 x i64> %shr
}
define <2 x i64> @test_none(<2 x i64> %m) {
; CHECK-P9-LABEL: test_none:
; CHECK-P9: # %bb.0: # %entry
; CHECK-P9-NEXT: addis 3, 2, .LCPI5_0@toc@ha
; CHECK-P9-NEXT: addi 3, 3, .LCPI5_0@toc@l
; CHECK-P9-NEXT: lxvx 35, 0, 3
; CHECK-P9-NEXT: vsld 2, 2, 3
; CHECK-P9-NEXT: vsrad 2, 2, 3
; CHECK-P9-NEXT: blr
;
; CHECK-P9-NOALTIVEC-LABEL: test_none:
; CHECK-P9-NOALTIVEC: # %bb.0: # %entry
; CHECK-P9-NOALTIVEC-NEXT: sldi 3, 3, 16
; CHECK-P9-NOALTIVEC-NEXT: sldi 4, 4, 16
; CHECK-P9-NOALTIVEC-NEXT: sradi 3, 3, 16
; CHECK-P9-NOALTIVEC-NEXT: sradi 4, 4, 16
; CHECK-P9-NOALTIVEC-NEXT: blr
;
; CHECK-P8-LABEL: test_none:
; CHECK-P8: # %bb.0: # %entry
; CHECK-P8-NEXT: addis 3, 2, .LCPI5_0@toc@ha
; CHECK-P8-NEXT: addi 3, 3, .LCPI5_0@toc@l
; CHECK-P8-NEXT: lxvd2x 0, 0, 3
; CHECK-P8-NEXT: xxswapd 35, 0
; CHECK-P8-NEXT: vsld 2, 2, 3
; CHECK-P8-NEXT: vsrad 2, 2, 3
; CHECK-P8-NEXT: blr
entry:
%shl = shl <2 x i64> %m, <i64 16, i64 16>
%shr = ashr exact <2 x i64> %shl, <i64 16, i64 16>
ret <2 x i64> %shr
}