Skip to content

Commit e2b5a6b

Browse files
committed
Add Vector Compare Equal
1 parent 4f6c03e commit e2b5a6b

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

src/etc/platform-intrinsics/powerpc.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
"intrinsic_prefix": "_vec_",
44
"llvm_prefix": "llvm.ppc.altivec.",
55
"number_info": {
6-
"unsigned": {},
7-
"signed": {},
6+
"unsigned": {
7+
"data_type_short": { "8": "b", "16": "h", "32": "w", "64": "d" }
8+
},
9+
"signed": {
10+
"data_type_short": { "8": "b", "16": "h", "32": "w", "64": "d" }
11+
},
812
"float": {}
913
},
1014
"width_info": {
@@ -31,6 +35,13 @@
3135
"llvm": "vcmpbfp",
3236
"ret": "s32",
3337
"args": ["f32", "f32"]
38+
},
39+
{
40+
"intrinsic": "cmpeq{0.data_type_short}",
41+
"width": [128],
42+
"llvm": "vcmpequ{0.data_type_short}",
43+
"ret": "s(8-32)",
44+
"args": ["0", "0"]
3445
}
3546
]
3647
}

src/librustc_platform_intrinsics/powerpc.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ pub fn find(name: &str) -> Option<Intrinsic> {
3737
output: &::I32x4,
3838
definition: Named("llvm.ppc.altivec.vcmpbfp")
3939
},
40+
"_vec_cmpeqb" => Intrinsic {
41+
inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I8x16]; &INPUTS },
42+
output: &::I8x16,
43+
definition: Named("llvm.ppc.altivec.vcmpequb")
44+
},
45+
"_vec_cmpeqh" => Intrinsic {
46+
inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS },
47+
output: &::I16x8,
48+
definition: Named("llvm.ppc.altivec.vcmpequh")
49+
},
50+
"_vec_cmpeqw" => Intrinsic {
51+
inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS },
52+
output: &::I32x4,
53+
definition: Named("llvm.ppc.altivec.vcmpequw")
54+
},
4055
_ => return None,
4156
})
4257
}

0 commit comments

Comments
 (0)