Skip to content

Commit

Permalink
Add support for Vector Unpack High and Low on PowerPC
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Aug 16, 2017
1 parent 88fc6dc commit 5d91eda
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/etc/platform-intrinsics/powerpc.json
Expand Up @@ -142,6 +142,20 @@
"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"]
}
]
}
20 changes: 20 additions & 0 deletions src/librustc_platform_intrinsics/powerpc.rs
Expand Up @@ -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,
})
}

0 comments on commit 5d91eda

Please sign in to comment.