From cccf3e7a5c728efcab668697e6f7fa1235c6c9bd 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 Multiply Sum Saturated on PowerPC --- src/etc/platform-intrinsics/powerpc.json | 7 +++++++ src/librustc_platform_intrinsics/powerpc.rs | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/etc/platform-intrinsics/powerpc.json b/src/etc/platform-intrinsics/powerpc.json index 306ccea903e..4ed1ecd7639 100644 --- a/src/etc/platform-intrinsics/powerpc.json +++ b/src/etc/platform-intrinsics/powerpc.json @@ -184,6 +184,13 @@ "llvm": "vmsumshm", "ret": "s32", "args": ["s16", "s16", "s32"] + }, + { + "intrinsic": "msum{0.kind}hs", + "width": [128], + "llvm": "vmsum{0.kind}hs", + "ret": "i32", + "args": ["0N", "0N", "0"] } ] } diff --git a/src/librustc_platform_intrinsics/powerpc.rs b/src/librustc_platform_intrinsics/powerpc.rs index 437dae48913..b205321d10f 100644 --- a/src/librustc_platform_intrinsics/powerpc.rs +++ b/src/librustc_platform_intrinsics/powerpc.rs @@ -362,6 +362,16 @@ pub fn find(name: &str) -> Option { output: &::I32x4, definition: Named("llvm.ppc.altivec.vmsumshm") }, + "_vec_msumshs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 3] = [&::I16x8, &::I16x8, &::I32x4]; &INPUTS }, + output: &::I32x4, + definition: Named("llvm.ppc.altivec.vmsumshs") + }, + "_vec_msumuhs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 3] = [&::U16x8, &::U16x8, &::U32x4]; &INPUTS }, + output: &::U32x4, + definition: Named("llvm.ppc.altivec.vmsumuhs") + }, _ => return None, }) }