Skip to content

Commit b07a059

Browse files
committed
Add support for Vector Subtract Saturated on PowerPC
1 parent c701ba6 commit b07a059

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

src/etc/platform-intrinsics/powerpc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@
7272
"llvm": "vmin{0.kind}{0.data_type_short}",
7373
"ret": "i(8-32)",
7474
"args": ["0", "0"]
75+
},
76+
{
77+
"intrinsic": "sub{0.kind}{0.data_type_short}s",
78+
"width": [128],
79+
"llvm": "vsub{0.kind}{0.data_type_short}s",
80+
"ret": "i(8-32)",
81+
"args": ["0", "0"]
7582
}
7683
]
7784
}

src/librustc_platform_intrinsics/powerpc.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,36 @@ pub fn find(name: &str) -> Option<Intrinsic> {
142142
output: &::U32x4,
143143
definition: Named("llvm.ppc.altivec.vminuw")
144144
},
145+
"_vec_subsbs" => Intrinsic {
146+
inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I8x16]; &INPUTS },
147+
output: &::I8x16,
148+
definition: Named("llvm.ppc.altivec.vsubsbs")
149+
},
150+
"_vec_sububs" => Intrinsic {
151+
inputs: { static INPUTS: [&'static Type; 2] = [&::U8x16, &::U8x16]; &INPUTS },
152+
output: &::U8x16,
153+
definition: Named("llvm.ppc.altivec.vsububs")
154+
},
155+
"_vec_subshs" => Intrinsic {
156+
inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS },
157+
output: &::I16x8,
158+
definition: Named("llvm.ppc.altivec.vsubshs")
159+
},
160+
"_vec_subuhs" => Intrinsic {
161+
inputs: { static INPUTS: [&'static Type; 2] = [&::U16x8, &::U16x8]; &INPUTS },
162+
output: &::U16x8,
163+
definition: Named("llvm.ppc.altivec.vsubuhs")
164+
},
165+
"_vec_subsws" => Intrinsic {
166+
inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS },
167+
output: &::I32x4,
168+
definition: Named("llvm.ppc.altivec.vsubsws")
169+
},
170+
"_vec_subuws" => Intrinsic {
171+
inputs: { static INPUTS: [&'static Type; 2] = [&::U32x4, &::U32x4]; &INPUTS },
172+
output: &::U32x4,
173+
definition: Named("llvm.ppc.altivec.vsubuws")
174+
},
145175
_ => return None,
146176
})
147177
}

0 commit comments

Comments
 (0)