Skip to content

Commit 7f3be0a

Browse files
committed
Auto merge of #43897 - lu-zero:master, r=alexcrichton
More PowerPC intrinsics
2 parents 4ac7646 + 5d91eda commit 7f3be0a

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

src/etc/platform-intrinsics/powerpc.json

+35
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,41 @@
121121
"llvm": "vavg{0.kind}{0.data_type_short}",
122122
"ret": "i(8-32)",
123123
"args": ["0", "0"]
124+
},
125+
{
126+
"intrinsic": "packs{0.kind}{1.data_type_short}",
127+
"width": [128],
128+
"llvm": "vpk{0.kind}{1.data_type_short}{0.kind}s",
129+
"ret": "i(8-16)",
130+
"args": ["0W", "1"]
131+
},
132+
{
133+
"intrinsic": "packsu{1.kind}{1.data_type_short}",
134+
"width": [128],
135+
"llvm": "vpk{1.kind}{1.data_type_short}{0.kind}s",
136+
"ret": "u(8-16)",
137+
"args": ["0Ws", "1"]
138+
},
139+
{
140+
"intrinsic": "packpx",
141+
"width": [128],
142+
"llvm": "vpkpx",
143+
"ret": "s16",
144+
"args": ["s32", "s32"]
145+
},
146+
{
147+
"intrinsic": "unpackl{1.kind}{1.data_type_short}",
148+
"width": [128],
149+
"llvm": "vupkl{1.kind}{1.data_type_short}",
150+
"ret": "s(16-32)",
151+
"args": ["0N"]
152+
},
153+
{
154+
"intrinsic": "unpackh{1.kind}{1.data_type_short}",
155+
"width": [128],
156+
"llvm": "vupkh{1.kind}{1.data_type_short}",
157+
"ret": "s(16-32)",
158+
"args": ["0N"]
124159
}
125160
]
126161
}

src/librustc_platform_intrinsics/powerpc.rs

+55
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,61 @@ pub fn find(name: &str) -> Option<Intrinsic> {
282282
output: &::U32x4,
283283
definition: Named("llvm.ppc.altivec.vavguw")
284284
},
285+
"_vec_packssh" => Intrinsic {
286+
inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS },
287+
output: &::I8x16,
288+
definition: Named("llvm.ppc.altivec.vpkshss")
289+
},
290+
"_vec_packsuh" => Intrinsic {
291+
inputs: { static INPUTS: [&'static Type; 2] = [&::U16x8, &::U16x8]; &INPUTS },
292+
output: &::U8x16,
293+
definition: Named("llvm.ppc.altivec.vpkuhus")
294+
},
295+
"_vec_packssw" => Intrinsic {
296+
inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS },
297+
output: &::I16x8,
298+
definition: Named("llvm.ppc.altivec.vpkswss")
299+
},
300+
"_vec_packsuw" => Intrinsic {
301+
inputs: { static INPUTS: [&'static Type; 2] = [&::U32x4, &::U32x4]; &INPUTS },
302+
output: &::U16x8,
303+
definition: Named("llvm.ppc.altivec.vpkuwus")
304+
},
305+
"_vec_packsush" => Intrinsic {
306+
inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS },
307+
output: &::U8x16,
308+
definition: Named("llvm.ppc.altivec.vpkshus")
309+
},
310+
"_vec_packsusw" => Intrinsic {
311+
inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS },
312+
output: &::U16x8,
313+
definition: Named("llvm.ppc.altivec.vpkswus")
314+
},
315+
"_vec_packpx" => Intrinsic {
316+
inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS },
317+
output: &::I16x8,
318+
definition: Named("llvm.ppc.altivec.vpkpx")
319+
},
320+
"_vec_unpacklsb" => Intrinsic {
321+
inputs: { static INPUTS: [&'static Type; 1] = [&::I8x16]; &INPUTS },
322+
output: &::I16x8,
323+
definition: Named("llvm.ppc.altivec.vupklsb")
324+
},
325+
"_vec_unpacklsh" => Intrinsic {
326+
inputs: { static INPUTS: [&'static Type; 1] = [&::I16x8]; &INPUTS },
327+
output: &::I32x4,
328+
definition: Named("llvm.ppc.altivec.vupklsh")
329+
},
330+
"_vec_unpackhsb" => Intrinsic {
331+
inputs: { static INPUTS: [&'static Type; 1] = [&::I8x16]; &INPUTS },
332+
output: &::I16x8,
333+
definition: Named("llvm.ppc.altivec.vupkhsb")
334+
},
335+
"_vec_unpackhsh" => Intrinsic {
336+
inputs: { static INPUTS: [&'static Type; 1] = [&::I16x8]; &INPUTS },
337+
output: &::I32x4,
338+
definition: Named("llvm.ppc.altivec.vupkhsh")
339+
},
285340
_ => return None,
286341
})
287342
}

0 commit comments

Comments
 (0)