From b07a0596439532d78142c92e1f1a9ae14e8ae9f5 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Fri, 4 Aug 2017 00:16:22 +0000 Subject: [PATCH] Add support for Vector Subtract Saturated on PowerPC --- src/etc/platform-intrinsics/powerpc.json | 7 +++++ src/librustc_platform_intrinsics/powerpc.rs | 30 +++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/etc/platform-intrinsics/powerpc.json b/src/etc/platform-intrinsics/powerpc.json index 7f01aaa3ac1..cf9b7a16732 100644 --- a/src/etc/platform-intrinsics/powerpc.json +++ b/src/etc/platform-intrinsics/powerpc.json @@ -72,6 +72,13 @@ "llvm": "vmin{0.kind}{0.data_type_short}", "ret": "i(8-32)", "args": ["0", "0"] + }, + { + "intrinsic": "sub{0.kind}{0.data_type_short}s", + "width": [128], + "llvm": "vsub{0.kind}{0.data_type_short}s", + "ret": "i(8-32)", + "args": ["0", "0"] } ] } diff --git a/src/librustc_platform_intrinsics/powerpc.rs b/src/librustc_platform_intrinsics/powerpc.rs index 60074cce2b9..4825a736e72 100644 --- a/src/librustc_platform_intrinsics/powerpc.rs +++ b/src/librustc_platform_intrinsics/powerpc.rs @@ -142,6 +142,36 @@ pub fn find(name: &str) -> Option { output: &::U32x4, definition: Named("llvm.ppc.altivec.vminuw") }, + "_vec_subsbs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I8x16]; &INPUTS }, + output: &::I8x16, + definition: Named("llvm.ppc.altivec.vsubsbs") + }, + "_vec_sububs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::U8x16, &::U8x16]; &INPUTS }, + output: &::U8x16, + definition: Named("llvm.ppc.altivec.vsububs") + }, + "_vec_subshs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS }, + output: &::I16x8, + definition: Named("llvm.ppc.altivec.vsubshs") + }, + "_vec_subuhs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::U16x8, &::U16x8]; &INPUTS }, + output: &::U16x8, + definition: Named("llvm.ppc.altivec.vsubuhs") + }, + "_vec_subsws" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS }, + output: &::I32x4, + definition: Named("llvm.ppc.altivec.vsubsws") + }, + "_vec_subuws" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::U32x4, &::U32x4]; &INPUTS }, + output: &::U32x4, + definition: Named("llvm.ppc.altivec.vsubuws") + }, _ => return None, }) }