Skip to content

Commit 381cbe4

Browse files
committed
Add support for Vector Add Saturated on PowerPC
1 parent 844e9ad commit 381cbe4

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
@@ -86,6 +86,13 @@
8686
"llvm": "vsubcuw",
8787
"ret": "u32",
8888
"args": ["0", "0"]
89+
},
90+
{
91+
"intrinsic": "add{0.kind}{0.data_type_short}s",
92+
"width": [128],
93+
"llvm": "vadd{0.kind}{0.data_type_short}s",
94+
"ret": "i(8-32)",
95+
"args": ["0", "0"]
8996
}
9097
]
9198
}

src/librustc_platform_intrinsics/powerpc.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,36 @@ pub fn find(name: &str) -> Option<Intrinsic> {
177177
output: &::U32x4,
178178
definition: Named("llvm.ppc.altivec.vsubcuw")
179179
},
180+
"_vec_addsbs" => Intrinsic {
181+
inputs: { static INPUTS: [&'static Type; 2] = [&::I8x16, &::I8x16]; &INPUTS },
182+
output: &::I8x16,
183+
definition: Named("llvm.ppc.altivec.vaddsbs")
184+
},
185+
"_vec_addubs" => Intrinsic {
186+
inputs: { static INPUTS: [&'static Type; 2] = [&::U8x16, &::U8x16]; &INPUTS },
187+
output: &::U8x16,
188+
definition: Named("llvm.ppc.altivec.vaddubs")
189+
},
190+
"_vec_addshs" => Intrinsic {
191+
inputs: { static INPUTS: [&'static Type; 2] = [&::I16x8, &::I16x8]; &INPUTS },
192+
output: &::I16x8,
193+
definition: Named("llvm.ppc.altivec.vaddshs")
194+
},
195+
"_vec_adduhs" => Intrinsic {
196+
inputs: { static INPUTS: [&'static Type; 2] = [&::U16x8, &::U16x8]; &INPUTS },
197+
output: &::U16x8,
198+
definition: Named("llvm.ppc.altivec.vadduhs")
199+
},
200+
"_vec_addsws" => Intrinsic {
201+
inputs: { static INPUTS: [&'static Type; 2] = [&::I32x4, &::I32x4]; &INPUTS },
202+
output: &::I32x4,
203+
definition: Named("llvm.ppc.altivec.vaddsws")
204+
},
205+
"_vec_adduws" => Intrinsic {
206+
inputs: { static INPUTS: [&'static Type; 2] = [&::U32x4, &::U32x4]; &INPUTS },
207+
output: &::U32x4,
208+
definition: Named("llvm.ppc.altivec.vadduws")
209+
},
180210
_ => return None,
181211
})
182212
}

0 commit comments

Comments
 (0)