Skip to content

Commit a718c81

Browse files
committed
Add support for Vector Maximum on PowerPC
1 parent ade5ead commit a718c81

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

src/etc/platform-intrinsics/powerpc.json

+7
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@
5858
"llvm": "vcmpgt{1.kind}{1.data_type_short}",
5959
"ret": "s(8-32)",
6060
"args": ["0", "1"]
61+
},
62+
{
63+
"intrinsic": "max{0.kind}{0.data_type_short}",
64+
"width": [128],
65+
"llvm": "vmax{0.kind}{0.data_type_short}",
66+
"ret": "i(8-32)",
67+
"args": ["0", "0"]
6168
}
6269
]
6370
}

src/librustc_platform_intrinsics/powerpc.rs

+30
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,36 @@ pub fn find(name: &str) -> Option<Intrinsic> {
8282
output: &::I32x4,
8383
definition: Named("llvm.ppc.altivec.vcmpgtsw")
8484
},
85+
"_vec_maxsb" => Intrinsic {
86+
inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I8x16]; &INPUTS },
87+
output: &::I8x16,
88+
definition: Named("llvm.ppc.altivec.vmaxsb")
89+
},
90+
"_vec_maxub" => Intrinsic {
91+
inputs: { static INPUTS: [&'static Type; 2] = [&::U8x16, &::U8x16]; &INPUTS },
92+
output: &::U8x16,
93+
definition: Named("llvm.ppc.altivec.vmaxub")
94+
},
95+
"_vec_maxsh" => Intrinsic {
96+
inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS },
97+
output: &::I16x8,
98+
definition: Named("llvm.ppc.altivec.vmaxsh")
99+
},
100+
"_vec_maxuh" => Intrinsic {
101+
inputs: { static INPUTS: [&'static Type; 2] = [&::U16x8, &::U16x8]; &INPUTS },
102+
output: &::U16x8,
103+
definition: Named("llvm.ppc.altivec.vmaxuh")
104+
},
105+
"_vec_maxsw" => Intrinsic {
106+
inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS },
107+
output: &::I32x4,
108+
definition: Named("llvm.ppc.altivec.vmaxsw")
109+
},
110+
"_vec_maxuw" => Intrinsic {
111+
inputs: { static INPUTS: [&'static Type; 2] = [&::U32x4, &::U32x4]; &INPUTS },
112+
output: &::U32x4,
113+
definition: Named("llvm.ppc.altivec.vmaxuw")
114+
},
85115
_ => return None,
86116
})
87117
}

0 commit comments

Comments
 (0)