Skip to content

Commit cbce0aa

Browse files
committed
Add support for Vector Minimum on PowerPC
1 parent a718c81 commit cbce0aa

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
@@ -65,6 +65,13 @@
6565
"llvm": "vmax{0.kind}{0.data_type_short}",
6666
"ret": "i(8-32)",
6767
"args": ["0", "0"]
68+
},
69+
{
70+
"intrinsic": "min{0.kind}{0.data_type_short}",
71+
"width": [128],
72+
"llvm": "vmin{0.kind}{0.data_type_short}",
73+
"ret": "i(8-32)",
74+
"args": ["0", "0"]
6875
}
6976
]
7077
}

src/librustc_platform_intrinsics/powerpc.rs

+30
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,36 @@ pub fn find(name: &str) -> Option<Intrinsic> {
112112
output: &::U32x4,
113113
definition: Named("llvm.ppc.altivec.vmaxuw")
114114
},
115+
"_vec_minsb" => Intrinsic {
116+
inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I8x16]; &INPUTS },
117+
output: &::I8x16,
118+
definition: Named("llvm.ppc.altivec.vminsb")
119+
},
120+
"_vec_minub" => Intrinsic {
121+
inputs: { static INPUTS: [&'static Type; 2] = [&::U8x16, &::U8x16]; &INPUTS },
122+
output: &::U8x16,
123+
definition: Named("llvm.ppc.altivec.vminub")
124+
},
125+
"_vec_minsh" => Intrinsic {
126+
inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS },
127+
output: &::I16x8,
128+
definition: Named("llvm.ppc.altivec.vminsh")
129+
},
130+
"_vec_minuh" => Intrinsic {
131+
inputs: { static INPUTS: [&'static Type; 2] = [&::U16x8, &::U16x8]; &INPUTS },
132+
output: &::U16x8,
133+
definition: Named("llvm.ppc.altivec.vminuh")
134+
},
135+
"_vec_minsw" => Intrinsic {
136+
inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS },
137+
output: &::I32x4,
138+
definition: Named("llvm.ppc.altivec.vminsw")
139+
},
140+
"_vec_minuw" => Intrinsic {
141+
inputs: { static INPUTS: [&'static Type; 2] = [&::U32x4, &::U32x4]; &INPUTS },
142+
output: &::U32x4,
143+
definition: Named("llvm.ppc.altivec.vminuw")
144+
},
115145
_ => return None,
116146
})
117147
}

0 commit comments

Comments
 (0)