From 5d91eda8b38208e1e4a346ba06b1acbd939a9b04 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Fri, 4 Aug 2017 00:19:58 +0000 Subject: Add support for Vector Unpack High and Low on PowerPC --- src/etc/platform-intrinsics/powerpc.json | 14 ++++++++++++++ src/librustc_platform_intrinsics/powerpc.rs | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/etc/platform-intrinsics/powerpc.json b/src/etc/platform-intrinsics/powerpc.json index a5da54b1e93..d615037b632 100644 --- a/src/etc/platform-intrinsics/powerpc.json +++ b/src/etc/platform-intrinsics/powerpc.json @@ -142,6 +142,20 @@ "llvm": "vpkpx", "ret": "s16", "args": ["s32", "s32"] + }, + { + "intrinsic": "unpackl{1.kind}{1.data_type_short}", + "width": [128], + "llvm": "vupkl{1.kind}{1.data_type_short}", + "ret": "s(16-32)", + "args": ["0N"] + }, + { + "intrinsic": "unpackh{1.kind}{1.data_type_short}", + "width": [128], + "llvm": "vupkh{1.kind}{1.data_type_short}", + "ret": "s(16-32)", + "args": ["0N"] } ] } diff --git a/src/librustc_platform_intrinsics/powerpc.rs b/src/librustc_platform_intrinsics/powerpc.rs index c3eaf3d821e..1a2e8e9c5d8 100644 --- a/src/librustc_platform_intrinsics/powerpc.rs +++ b/src/librustc_platform_intrinsics/powerpc.rs @@ -317,6 +317,26 @@ pub fn find(name: &str) -> Option { output: &::I16x8, definition: Named("llvm.ppc.altivec.vpkpx") }, + "_vec_unpacklsb" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 1] = [&::I8x16]; &INPUTS }, + output: &::I16x8, + definition: Named("llvm.ppc.altivec.vupklsb") + }, + "_vec_unpacklsh" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 1] = [&::I16x8]; &INPUTS }, + output: &::I32x4, + definition: Named("llvm.ppc.altivec.vupklsh") + }, + "_vec_unpackhsb" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 1] = [&::I8x16]; &INPUTS }, + output: &::I16x8, + definition: Named("llvm.ppc.altivec.vupkhsb") + }, + "_vec_unpackhsh" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 1] = [&::I16x8]; &INPUTS }, + output: &::I32x4, + definition: Named("llvm.ppc.altivec.vupkhsh") + }, _ => return None, }) } -- cgit v1.2.1