From eec1c178b3ebddfeb86ce76472b0285f871d2255 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Fri, 4 Aug 2017 00:19:58 +0000 Subject: [PATCH] Add support for Vector Sum Across Partial 1/4 Saturated on PowerPC --- src/etc/platform-intrinsics/powerpc.json | 14 ++++++++++++++ src/librustc_platform_intrinsics/powerpc.rs | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/etc/platform-intrinsics/powerpc.json b/src/etc/platform-intrinsics/powerpc.json index eb443f2077a..1f78363e43b 100644 --- a/src/etc/platform-intrinsics/powerpc.json +++ b/src/etc/platform-intrinsics/powerpc.json @@ -198,6 +198,20 @@ "llvm": "vsum2sws", "ret": "s32", "args": ["0", "0"] + }, + { + "intrinsic": "sum4{0.kind}bs", + "width": [128], + "llvm": "vsum4{0.kind}bs", + "ret": "i32", + "args": ["0NN", "0"] + }, + { + "intrinsic": "sum4shs", + "width": [128], + "llvm": "vsum4shs", + "ret": "s32", + "args": ["0N", "0"] } ] } diff --git a/src/librustc_platform_intrinsics/powerpc.rs b/src/librustc_platform_intrinsics/powerpc.rs index dd0967beda4..4d71c42edda 100644 --- a/src/librustc_platform_intrinsics/powerpc.rs +++ b/src/librustc_platform_intrinsics/powerpc.rs @@ -377,6 +377,21 @@ pub fn find(name: &str) -> Option { output: &::I32x4, definition: Named("llvm.ppc.altivec.vsum2sws") }, + "_vec_sum4sbs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I32x4]; &INPUTS }, + output: &::I32x4, + definition: Named("llvm.ppc.altivec.vsum4sbs") + }, + "_vec_sum4ubs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::U8x16, &::U32x4]; &INPUTS }, + output: &::U32x4, + definition: Named("llvm.ppc.altivec.vsum4ubs") + }, + "_vec_sum4shs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I32x4]; &INPUTS }, + output: &::I32x4, + definition: Named("llvm.ppc.altivec.vsum4shs") + }, _ => return None, }) }