Skip to content

Commit 5d91eda

Browse files
committed
Add support for Vector Unpack High and Low on PowerPC
1 parent 88fc6dc commit 5d91eda

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/etc/platform-intrinsics/powerpc.json

+14
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,20 @@
142142
"llvm": "vpkpx",
143143
"ret": "s16",
144144
"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"]
145159
}
146160
]
147161
}

src/librustc_platform_intrinsics/powerpc.rs

+20
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,26 @@ pub fn find(name: &str) -> Option<Intrinsic> {
317317
output: &::I16x8,
318318
definition: Named("llvm.ppc.altivec.vpkpx")
319319
},
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+
},
320340
_ => return None,
321341
})
322342
}

0 commit comments

Comments
 (0)