Skip to content

Commit

Permalink
Add support for Vector Multiply Add Saturated on PowerPC
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Aug 31, 2017
1 parent 5d91eda commit d308b0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/etc/platform-intrinsics/powerpc.json
Expand Up @@ -156,6 +156,13 @@
"llvm": "vupkh{1.kind}{1.data_type_short}",
"ret": "s(16-32)",
"args": ["0N"]
},
{
"intrinsic": "madds",
"width": [128],
"llvm": "vmhaddshs",
"ret": "s16",
"args": ["0", "0", "0"]
}
]
}
5 changes: 5 additions & 0 deletions src/librustc_platform_intrinsics/powerpc.rs
Expand Up @@ -337,6 +337,11 @@ pub fn find(name: &str) -> Option<Intrinsic> {
output: &::I32x4,
definition: Named("llvm.ppc.altivec.vupkhsh")
},
"_vec_madds" => Intrinsic {
inputs: { static INPUTS: [&'static Type; 3] = [&::I16x8, &::I16x8, &::I16x8]; &INPUTS },
output: &::I16x8,
definition: Named("llvm.ppc.altivec.vmhaddshs")
},
_ => return None,
})
}

0 comments on commit d308b0b

Please sign in to comment.