Skip to content

Commit c2cdcef

Browse files
committed
Add support for Vector Pack Saturated on PowerPC
1 parent e40dc66 commit c2cdcef

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/etc/platform-intrinsics/powerpc.json

+7
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@
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"]
124131
}
125132
]
126133
}

src/librustc_platform_intrinsics/powerpc.rs

+20
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,26 @@ 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+
},
285305
_ => return None,
286306
})
287307
}

0 commit comments

Comments
 (0)