summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2017-07-26 09:58:17 +0000
committerLuca Barbato <lu_zero@gentoo.org>2017-07-26 17:19:32 +0000
commita1995d3973e6ac28c9356d3beb53fba410aebf83 (patch)
treedd6e47467f799616941212d603d6e33ba5da2796
parente2b5a6b3bc4fcebbd1909186ae0398e8d2c29521 (diff)
downloadrust-a1995d3973e6ac28c9356d3beb53fba410aebf83.tar.gz
Add Vector Compare Greater-Than
-rw-r--r--src/etc/platform-intrinsics/powerpc.json16
-rw-r--r--src/librustc_platform_intrinsics/powerpc.rs30
2 files changed, 46 insertions, 0 deletions
diff --git a/src/etc/platform-intrinsics/powerpc.json b/src/etc/platform-intrinsics/powerpc.json
index 80ec7e956f8..55a199945f1 100644
--- a/src/etc/platform-intrinsics/powerpc.json
+++ b/src/etc/platform-intrinsics/powerpc.json
@@ -4,9 +4,11 @@
"llvm_prefix": "llvm.ppc.altivec.",
"number_info": {
"unsigned": {
+ "kind" : "u",
"data_type_short": { "8": "b", "16": "h", "32": "w", "64": "d" }
},
"signed": {
+ "kind" : "s",
"data_type_short": { "8": "b", "16": "h", "32": "w", "64": "d" }
},
"float": {}
@@ -42,6 +44,20 @@
"llvm": "vcmpequ{0.data_type_short}",
"ret": "s(8-32)",
"args": ["0", "0"]
+ },
+ {
+ "intrinsic": "cmpgt{1.kind}{1.data_type_short}",
+ "width": [128],
+ "llvm": "vcmpgt{1.kind}{1.data_type_short}",
+ "ret": "s(8-32)",
+ "args": ["0u", "1"]
+ },
+ {
+ "intrinsic": "cmpgt{1.kind}{1.data_type_short}",
+ "width": [128],
+ "llvm": "vcmpgt{1.kind}{1.data_type_short}",
+ "ret": "s(8-32)",
+ "args": ["0", "1"]
}
]
}
diff --git a/src/librustc_platform_intrinsics/powerpc.rs b/src/librustc_platform_intrinsics/powerpc.rs
index 3fa248d75d9..4be738eed81 100644
--- a/src/librustc_platform_intrinsics/powerpc.rs
+++ b/src/librustc_platform_intrinsics/powerpc.rs
@@ -52,6 +52,36 @@ pub fn find(name: &str) -> Option<Intrinsic> {
output: &::I32x4,
definition: Named("llvm.ppc.altivec.vcmpequw")
},
+ "_vec_cmpgtub" => Intrinsic {
+ inputs: { static INPUTS: [&'static Type; 2] = [&::U8x16, &::U8x16]; &INPUTS },
+ output: &::I8x16,
+ definition: Named("llvm.ppc.altivec.vcmpgtub")
+ },
+ "_vec_cmpgtuh" => Intrinsic {
+ inputs: { static INPUTS: [&'static Type; 2] = [&::U16x8, &::U16x8]; &INPUTS },
+ output: &::I16x8,
+ definition: Named("llvm.ppc.altivec.vcmpgtuh")
+ },
+ "_vec_cmpgtuw" => Intrinsic {
+ inputs: { static INPUTS: [&'static Type; 2] = [&::U32x4, &::U32x4]; &INPUTS },
+ output: &::I32x4,
+ definition: Named("llvm.ppc.altivec.vcmpgtuw")
+ },
+ "_vec_cmpgtsb" => Intrinsic {
+ inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I8x16]; &INPUTS },
+ output: &::I8x16,
+ definition: Named("llvm.ppc.altivec.vcmpgtsb")
+ },
+ "_vec_cmpgtsh" => Intrinsic {
+ inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS },
+ output: &::I16x8,
+ definition: Named("llvm.ppc.altivec.vcmpgtsh")
+ },
+ "_vec_cmpgtsw" => Intrinsic {
+ inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS },
+ output: &::I32x4,
+ definition: Named("llvm.ppc.altivec.vcmpgtsw")
+ },
_ => return None,
})
}