]> git.lizzy.rs Git - rust.git/commitdiff
Add support for Vector Unpack High and Low on PowerPC
authorLuca Barbato <lu_zero@gentoo.org>
Fri, 4 Aug 2017 00:19:58 +0000 (00:19 +0000)
committerLuca Barbato <lu_zero@gentoo.org>
Wed, 16 Aug 2017 05:04:42 +0000 (05:04 +0000)
src/etc/platform-intrinsics/powerpc.json
src/librustc_platform_intrinsics/powerpc.rs

index a5da54b1e93d31d12a001d718626473f1f38e325..d615037b632d7e3c258c3b1c5593b37f87490561 100644 (file)
             "llvm": "vpkpx",
             "ret": "s16",
             "args": ["s32", "s32"]
+        },
+        {
+            "intrinsic": "unpackl{1.kind}{1.data_type_short}",
+            "width": [128],
+            "llvm": "vupkl{1.kind}{1.data_type_short}",
+            "ret": "s(16-32)",
+            "args": ["0N"]
+        },
+        {
+            "intrinsic": "unpackh{1.kind}{1.data_type_short}",
+            "width": [128],
+            "llvm": "vupkh{1.kind}{1.data_type_short}",
+            "ret": "s(16-32)",
+            "args": ["0N"]
         }
     ]
 }
index c3eaf3d821e1cd5894ca102b0a1feae677e4faa4..1a2e8e9c5d868e384aa24f88375d43b737bb1a19 100644 (file)
@@ -317,6 +317,26 @@ pub fn find(name: &str) -> Option<Intrinsic> {
             output: &::I16x8,
             definition: Named("llvm.ppc.altivec.vpkpx")
         },
+        "_vec_unpacklsb" => Intrinsic {
+            inputs: { static INPUTS: [&'static Type; 1] = [&::I8x16]; &INPUTS },
+            output: &::I16x8,
+            definition: Named("llvm.ppc.altivec.vupklsb")
+        },
+        "_vec_unpacklsh" => Intrinsic {
+            inputs: { static INPUTS: [&'static Type; 1] = [&::I16x8]; &INPUTS },
+            output: &::I32x4,
+            definition: Named("llvm.ppc.altivec.vupklsh")
+        },
+        "_vec_unpackhsb" => Intrinsic {
+            inputs: { static INPUTS: [&'static Type; 1] = [&::I8x16]; &INPUTS },
+            output: &::I16x8,
+            definition: Named("llvm.ppc.altivec.vupkhsb")
+        },
+        "_vec_unpackhsh" => Intrinsic {
+            inputs: { static INPUTS: [&'static Type; 1] = [&::I16x8]; &INPUTS },
+            output: &::I32x4,
+            definition: Named("llvm.ppc.altivec.vupkhsh")
+        },
         _ => return None,
     })
 }