diff options
| author | Luca Barbato <lu_zero@gentoo.org> | 2017-08-04 00:19:58 +0000 |
|---|---|---|
| committer | Luca Barbato <lu_zero@gentoo.org> | 2017-08-06 06:31:10 +0000 |
| commit | 381cbe499483f73ec4eecc0345c156e8bdf951ae (patch) | |
| tree | 069e95dfa7ef81ab93f6d57856fed3e9b2e235ff | |
| parent | 844e9adf25efd251749d5833710a03e5ba1a2449 (diff) | |
| download | rust-381cbe499483f73ec4eecc0345c156e8bdf951ae.tar.gz rust-381cbe499483f73ec4eecc0345c156e8bdf951ae.zip | |
Add support for Vector Add Saturated on PowerPC
| -rw-r--r-- | src/etc/platform-intrinsics/powerpc.json | 7 | ||||
| -rw-r--r-- | src/librustc_platform_intrinsics/powerpc.rs | 30 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/etc/platform-intrinsics/powerpc.json b/src/etc/platform-intrinsics/powerpc.json index e7810109f3f..7805bb1057d 100644 --- a/src/etc/platform-intrinsics/powerpc.json +++ b/src/etc/platform-intrinsics/powerpc.json @@ -86,6 +86,13 @@ "llvm": "vsubcuw", "ret": "u32", "args": ["0", "0"] + }, + { + "intrinsic": "add{0.kind}{0.data_type_short}s", + "width": [128], + "llvm": "vadd{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 eb47595f4b0..0c686997eda 100644 --- a/src/librustc_platform_intrinsics/powerpc.rs +++ b/src/librustc_platform_intrinsics/powerpc.rs @@ -177,6 +177,36 @@ pub fn find(name: &str) -> Option<Intrinsic> { output: &::U32x4, definition: Named("llvm.ppc.altivec.vsubcuw") }, + "_vec_addsbs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I8x16]; &INPUTS }, + output: &::I8x16, + definition: Named("llvm.ppc.altivec.vaddsbs") + }, + "_vec_addubs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::U8x16, &::U8x16]; &INPUTS }, + output: &::U8x16, + definition: Named("llvm.ppc.altivec.vaddubs") + }, + "_vec_addshs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS }, + output: &::I16x8, + definition: Named("llvm.ppc.altivec.vaddshs") + }, + "_vec_adduhs" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::U16x8, &::U16x8]; &INPUTS }, + output: &::U16x8, + definition: Named("llvm.ppc.altivec.vadduhs") + }, + "_vec_addsws" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS }, + output: &::I32x4, + definition: Named("llvm.ppc.altivec.vaddsws") + }, + "_vec_adduws" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::U32x4, &::U32x4]; &INPUTS }, + output: &::U32x4, + definition: Named("llvm.ppc.altivec.vadduws") + }, _ => return None, }) } |
