From bb47972d4c02f1731792e76488e1d2bc266de080 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 Add Carryout on PowerPC --- src/etc/platform-intrinsics/powerpc.json | 7 +++++++ src/librustc_platform_intrinsics/powerpc.rs | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/etc/platform-intrinsics/powerpc.json b/src/etc/platform-intrinsics/powerpc.json index 7805bb1057d..7dde0fd4d08 100644 --- a/src/etc/platform-intrinsics/powerpc.json +++ b/src/etc/platform-intrinsics/powerpc.json @@ -93,6 +93,13 @@ "llvm": "vadd{0.kind}{0.data_type_short}s", "ret": "i(8-32)", "args": ["0", "0"] + }, + { + "intrinsic": "addc", + "width": [128], + "llvm": "vaddcuw", + "ret": "u32", + "args": ["0", "0"] } ] } diff --git a/src/librustc_platform_intrinsics/powerpc.rs b/src/librustc_platform_intrinsics/powerpc.rs index 0c686997eda..0ec6a7e66d8 100644 --- a/src/librustc_platform_intrinsics/powerpc.rs +++ b/src/librustc_platform_intrinsics/powerpc.rs @@ -207,6 +207,11 @@ pub fn find(name: &str) -> Option { output: &::U32x4, definition: Named("llvm.ppc.altivec.vadduws") }, + "_vec_addc" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::U32x4, &::U32x4]; &INPUTS }, + output: &::U32x4, + definition: Named("llvm.ppc.altivec.vaddcuw") + }, _ => return None, }) }