Skip to content

Commit

Permalink
Add support for Vector Pack Saturated Unsigned on PowerPC
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Aug 16, 2017
1 parent c2cdcef commit 1773233
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/etc/platform-intrinsics/powerpc.json
Expand Up @@ -128,6 +128,13 @@
"llvm": "vpk{0.kind}{1.data_type_short}{0.kind}s",
"ret": "i(8-16)",
"args": ["0W", "1"]
},
{
"intrinsic": "packsu{1.kind}{1.data_type_short}",
"width": [128],
"llvm": "vpk{1.kind}{1.data_type_short}{0.kind}s",
"ret": "u(8-16)",
"args": ["0Ws", "1"]
}
]
}
10 changes: 10 additions & 0 deletions src/librustc_platform_intrinsics/powerpc.rs
Expand Up @@ -302,6 +302,16 @@ pub fn find(name: &str) -> Option<Intrinsic> {
output: &::U16x8,
definition: Named("llvm.ppc.altivec.vpkuwus")
},
"_vec_packsush" => Intrinsic {
inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS },
output: &::U8x16,
definition: Named("llvm.ppc.altivec.vpkshus")
},
"_vec_packsusw" => Intrinsic {
inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS },
output: &::U16x8,
definition: Named("llvm.ppc.altivec.vpkswus")
},
_ => return None,
})
}

0 comments on commit 1773233

Please sign in to comment.