Skip to content

Commit a1995d3

Browse files
committed
Add Vector Compare Greater-Than
1 parent e2b5a6b commit a1995d3

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

src/etc/platform-intrinsics/powerpc.json

+16
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
"llvm_prefix": "llvm.ppc.altivec.",
55
"number_info": {
66
"unsigned": {
7+
"kind" : "u",
78
"data_type_short": { "8": "b", "16": "h", "32": "w", "64": "d" }
89
},
910
"signed": {
11+
"kind" : "s",
1012
"data_type_short": { "8": "b", "16": "h", "32": "w", "64": "d" }
1113
},
1214
"float": {}
@@ -42,6 +44,20 @@
4244
"llvm": "vcmpequ{0.data_type_short}",
4345
"ret": "s(8-32)",
4446
"args": ["0", "0"]
47+
},
48+
{
49+
"intrinsic": "cmpgt{1.kind}{1.data_type_short}",
50+
"width": [128],
51+
"llvm": "vcmpgt{1.kind}{1.data_type_short}",
52+
"ret": "s(8-32)",
53+
"args": ["0u", "1"]
54+
},
55+
{
56+
"intrinsic": "cmpgt{1.kind}{1.data_type_short}",
57+
"width": [128],
58+
"llvm": "vcmpgt{1.kind}{1.data_type_short}",
59+
"ret": "s(8-32)",
60+
"args": ["0", "1"]
4561
}
4662
]
4763
}

src/librustc_platform_intrinsics/powerpc.rs

+30
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,36 @@ pub fn find(name: &str) -> Option<Intrinsic> {
5252
output: &::I32x4,
5353
definition: Named("llvm.ppc.altivec.vcmpequw")
5454
},
55+
"_vec_cmpgtub" => Intrinsic {
56+
inputs: { static INPUTS: [&'static Type; 2] = [&::U8x16, &::U8x16]; &INPUTS },
57+
output: &::I8x16,
58+
definition: Named("llvm.ppc.altivec.vcmpgtub")
59+
},
60+
"_vec_cmpgtuh" => Intrinsic {
61+
inputs: { static INPUTS: [&'static Type; 2] = [&::U16x8, &::U16x8]; &INPUTS },
62+
output: &::I16x8,
63+
definition: Named("llvm.ppc.altivec.vcmpgtuh")
64+
},
65+
"_vec_cmpgtuw" => Intrinsic {
66+
inputs: { static INPUTS: [&'static Type; 2] = [&::U32x4, &::U32x4]; &INPUTS },
67+
output: &::I32x4,
68+
definition: Named("llvm.ppc.altivec.vcmpgtuw")
69+
},
70+
"_vec_cmpgtsb" => Intrinsic {
71+
inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I8x16]; &INPUTS },
72+
output: &::I8x16,
73+
definition: Named("llvm.ppc.altivec.vcmpgtsb")
74+
},
75+
"_vec_cmpgtsh" => Intrinsic {
76+
inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS },
77+
output: &::I16x8,
78+
definition: Named("llvm.ppc.altivec.vcmpgtsh")
79+
},
80+
"_vec_cmpgtsw" => Intrinsic {
81+
inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS },
82+
output: &::I32x4,
83+
definition: Named("llvm.ppc.altivec.vcmpgtsw")
84+
},
5585
_ => return None,
5686
})
5787
}

0 commit comments

Comments
 (0)