Skip to content

Commit 1773233

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

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/etc/platform-intrinsics/powerpc.json

+7
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@
128128
"llvm": "vpk{0.kind}{1.data_type_short}{0.kind}s",
129129
"ret": "i(8-16)",
130130
"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"]
131138
}
132139
]
133140
}

src/librustc_platform_intrinsics/powerpc.rs

+10
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,16 @@ pub fn find(name: &str) -> Option<Intrinsic> {
302302
output: &::U16x8,
303303
definition: Named("llvm.ppc.altivec.vpkuwus")
304304
},
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+
},
305315
_ => return None,
306316
})
307317
}

0 commit comments

Comments
 (0)