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-07 07:44:27 +0000 |
| commit | 8b78ea5b84cd528bce291bd8196bc83cd96c9819 (patch) | |
| tree | b1a92a24bc9881e407a8b5f60683423ecf8ea9fb /src | |
| parent | 19c4bdb4e12ada030e64a731a3b588867c58025e (diff) | |
| download | rust-8b78ea5b84cd528bce291bd8196bc83cd96c9819.tar.gz rust-8b78ea5b84cd528bce291bd8196bc83cd96c9819.zip | |
Add support for Vector Average on PowerPC
Diffstat (limited to 'src')
| -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 abccc8747e4..c70791be030 100644 --- a/src/etc/platform-intrinsics/powerpc.json +++ b/src/etc/platform-intrinsics/powerpc.json @@ -114,6 +114,13 @@ "llvm": "vmulo{0.kind}{1.data_type_short}", "ret": "i(16-32)", "args": ["0N", "1"] + }, + { + "intrinsic": "avg{0.kind}{0.data_type_short}", + "width": [128], + "llvm": "vavg{0.kind}{0.data_type_short}", + "ret": "i(8-32)", + "args": ["0", "0"] } ] } diff --git a/src/librustc_platform_intrinsics/powerpc.rs b/src/librustc_platform_intrinsics/powerpc.rs index d9c00a8e627..b38369665f8 100644 --- a/src/librustc_platform_intrinsics/powerpc.rs +++ b/src/librustc_platform_intrinsics/powerpc.rs @@ -252,6 +252,36 @@ pub fn find(name: &str) -> Option<Intrinsic> { output: &::U32x4, definition: Named("llvm.ppc.altivec.vmulouh") }, + "_vec_avgsb" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I8x16]; &INPUTS }, + output: &::I8x16, + definition: Named("llvm.ppc.altivec.vavgsb") + }, + "_vec_avgub" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::U8x16, &::U8x16]; &INPUTS }, + output: &::U8x16, + definition: Named("llvm.ppc.altivec.vavgub") + }, + "_vec_avgsh" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS }, + output: &::I16x8, + definition: Named("llvm.ppc.altivec.vavgsh") + }, + "_vec_avguh" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::U16x8, &::U16x8]; &INPUTS }, + output: &::U16x8, + definition: Named("llvm.ppc.altivec.vavguh") + }, + "_vec_avgsw" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS }, + output: &::I32x4, + definition: Named("llvm.ppc.altivec.vavgsw") + }, + "_vec_avguw" => Intrinsic { + inputs: { static INPUTS: [&'static Type; 2] = [&::U32x4, &::U32x4]; &INPUTS }, + output: &::U32x4, + definition: Named("llvm.ppc.altivec.vavguw") + }, _ => return None, }) } |
