Skip to content

Commit

Permalink
Add support for Vector Multiply Sum on PowerPC
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Aug 31, 2017
1 parent d308b0b commit 078c3dd
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/etc/platform-intrinsics/powerpc.json
Expand Up @@ -163,6 +163,27 @@
"llvm": "vmhaddshs",
"ret": "s16",
"args": ["0", "0", "0"]
},
{
"intrinsic": "msumu{1.data_type_short}m",
"width": [128],
"llvm": "vmsumu{1.data_type_short}m",
"ret": "u32",
"args": ["u(8-16)", "1", "u32"]
},
{
"intrinsic": "msummbm",
"width": [128],
"llvm": "vmsummbm",
"ret": "s32",
"args": ["s8", "u8", "s32"]
},
{
"intrinsic": "msumshm",
"width": [128],
"llvm": "vmsumshm",
"ret": "s32",
"args": ["s16", "s16", "s32"]
}
]
}
20 changes: 20 additions & 0 deletions src/librustc_platform_intrinsics/powerpc.rs
Expand Up @@ -342,6 +342,26 @@ pub fn find(name: &str) -> Option<Intrinsic> {
output: &::I16x8,
definition: Named("llvm.ppc.altivec.vmhaddshs")
},
"_vec_msumubm" => Intrinsic {
inputs: { static INPUTS: [&'static Type; 3] = [&::U8x16, &::U8x16, &::U32x4]; &INPUTS },
output: &::U32x4,
definition: Named("llvm.ppc.altivec.vmsumubm")
},
"_vec_msumuhm" => Intrinsic {
inputs: { static INPUTS: [&'static Type; 3] = [&::U16x8, &::U16x8, &::U32x4]; &INPUTS },
output: &::U32x4,
definition: Named("llvm.ppc.altivec.vmsumuhm")
},
"_vec_msummbm" => Intrinsic {
inputs: { static INPUTS: [&'static Type; 3] = [&::I8x16, &::U8x16, &::I32x4]; &INPUTS },
output: &::I32x4,
definition: Named("llvm.ppc.altivec.vmsummbm")
},
"_vec_msumshm" => Intrinsic {
inputs: { static INPUTS: [&'static Type; 3] = [&::I16x8, &::I16x8, &::I32x4]; &INPUTS },
output: &::I32x4,
definition: Named("llvm.ppc.altivec.vmsumshm")
},
_ => return None,
})
}

0 comments on commit 078c3dd

Please sign in to comment.