Skip to content

Commit 078c3dd

Browse files
committed
Add support for Vector Multiply Sum on PowerPC
1 parent d308b0b commit 078c3dd

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

src/etc/platform-intrinsics/powerpc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,27 @@
163163
"llvm": "vmhaddshs",
164164
"ret": "s16",
165165
"args": ["0", "0", "0"]
166+
},
167+
{
168+
"intrinsic": "msumu{1.data_type_short}m",
169+
"width": [128],
170+
"llvm": "vmsumu{1.data_type_short}m",
171+
"ret": "u32",
172+
"args": ["u(8-16)", "1", "u32"]
173+
},
174+
{
175+
"intrinsic": "msummbm",
176+
"width": [128],
177+
"llvm": "vmsummbm",
178+
"ret": "s32",
179+
"args": ["s8", "u8", "s32"]
180+
},
181+
{
182+
"intrinsic": "msumshm",
183+
"width": [128],
184+
"llvm": "vmsumshm",
185+
"ret": "s32",
186+
"args": ["s16", "s16", "s32"]
166187
}
167188
]
168189
}

src/librustc_platform_intrinsics/powerpc.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,26 @@ pub fn find(name: &str) -> Option<Intrinsic> {
342342
output: &::I16x8,
343343
definition: Named("llvm.ppc.altivec.vmhaddshs")
344344
},
345+
"_vec_msumubm" => Intrinsic {
346+
inputs: { static INPUTS: [&'static Type; 3] = [&::U8x16, &::U8x16, &::U32x4]; &INPUTS },
347+
output: &::U32x4,
348+
definition: Named("llvm.ppc.altivec.vmsumubm")
349+
},
350+
"_vec_msumuhm" => Intrinsic {
351+
inputs: { static INPUTS: [&'static Type; 3] = [&::U16x8, &::U16x8, &::U32x4]; &INPUTS },
352+
output: &::U32x4,
353+
definition: Named("llvm.ppc.altivec.vmsumuhm")
354+
},
355+
"_vec_msummbm" => Intrinsic {
356+
inputs: { static INPUTS: [&'static Type; 3] = [&::I8x16, &::U8x16, &::I32x4]; &INPUTS },
357+
output: &::I32x4,
358+
definition: Named("llvm.ppc.altivec.vmsummbm")
359+
},
360+
"_vec_msumshm" => Intrinsic {
361+
inputs: { static INPUTS: [&'static Type; 3] = [&::I16x8, &::I16x8, &::I32x4]; &INPUTS },
362+
output: &::I32x4,
363+
definition: Named("llvm.ppc.altivec.vmsumshm")
364+
},
345365
_ => return None,
346366
})
347367
}

0 commit comments

Comments
 (0)