Skip to content

Commit 9c6ab92

Browse files
committed
Add support for Vector Multiply Even on PowerPC
1 parent 380b818 commit 9c6ab92

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/etc/platform-intrinsics/powerpc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@
100100
"llvm": "vaddcuw",
101101
"ret": "u32",
102102
"args": ["0", "0"]
103+
},
104+
{
105+
"intrinsic": "mule{1.kind}{1.data_type_short}",
106+
"width": [128],
107+
"llvm": "vmule{0.kind}{1.data_type_short}",
108+
"ret": "i(16-32)",
109+
"args": ["0N", "1"]
103110
}
104111
]
105112
}

src/librustc_platform_intrinsics/powerpc.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,26 @@ pub fn find(name: &str) -> Option<Intrinsic> {
212212
output: &::U32x4,
213213
definition: Named("llvm.ppc.altivec.vaddcuw")
214214
},
215+
"_vec_mulesb" => Intrinsic {
216+
inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I8x16]; &INPUTS },
217+
output: &::I16x8,
218+
definition: Named("llvm.ppc.altivec.vmulesb")
219+
},
220+
"_vec_muleub" => Intrinsic {
221+
inputs: { static INPUTS: [&'static Type; 2] = [&::U8x16, &::U8x16]; &INPUTS },
222+
output: &::U16x8,
223+
definition: Named("llvm.ppc.altivec.vmuleub")
224+
},
225+
"_vec_mulesh" => Intrinsic {
226+
inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS },
227+
output: &::I32x4,
228+
definition: Named("llvm.ppc.altivec.vmulesh")
229+
},
230+
"_vec_muleuh" => Intrinsic {
231+
inputs: { static INPUTS: [&'static Type; 2] = [&::U16x8, &::U16x8]; &INPUTS },
232+
output: &::U32x4,
233+
definition: Named("llvm.ppc.altivec.vmuleuh")
234+
},
215235
_ => return None,
216236
})
217237
}

0 commit comments

Comments
 (0)