Skip to content

Commit 93101b5

Browse files
committed
s390x: use the new u128::funnel_shl
1 parent e1a3b8b commit 93101b5

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

library/stdarch/crates/core_arch/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
x86_amx_intrinsics,
3434
f16,
3535
aarch64_unstable_target_feature,
36-
bigint_helper_methods
36+
bigint_helper_methods,
37+
funnel_shifts
3738
)]
3839
#![cfg_attr(test, feature(test, abi_vectorcall, stdarch_internal))]
3940
#![deny(clippy::missing_inline_in_public_items)]

library/stdarch/crates/core_arch/src/s390x/vector.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3513,17 +3513,6 @@ mod sealed {
35133513
a.vec_srdb::<7>(b)
35143514
}
35153515

3516-
unsafe fn funnel_shl_u128(a: u128, b: u128, c: u128) -> u128 {
3517-
#[repr(simd)]
3518-
struct Single([u128; 1]);
3519-
3520-
transmute(simd_funnel_shl::<Single>(
3521-
transmute(a),
3522-
transmute(b),
3523-
transmute(c),
3524-
))
3525-
}
3526-
35273516
macro_rules! impl_vec_sld {
35283517
($($ty:ident)*) => {
35293518
$(
@@ -3533,21 +3522,21 @@ mod sealed {
35333522
#[target_feature(enable = "vector")]
35343523
unsafe fn vec_sld<const C: u32>(self, b: Self) -> Self {
35353524
static_assert_uimm_bits!(C, 4);
3536-
transmute(funnel_shl_u128(transmute(self), transmute(b), const { C as u128 * 8 }))
3525+
transmute(u128::funnel_shl(transmute(self), transmute(b), C * 8))
35373526
}
35383527

35393528
#[inline]
35403529
#[target_feature(enable = "vector")]
35413530
unsafe fn vec_sldw<const C: u32>(self, b: Self) -> Self {
35423531
static_assert_uimm_bits!(C, 2);
3543-
transmute(funnel_shl_u128(transmute(self), transmute(b), const { C as u128 * 4 * 8 }))
3532+
transmute(u128::funnel_shl(transmute(self), transmute(b), C * 4 * 8))
35443533
}
35453534

35463535
#[inline]
35473536
#[target_feature(enable = "vector-enhancements-2")]
35483537
unsafe fn vec_sldb<const C: u32>(self, b: Self) -> Self {
35493538
static_assert_uimm_bits!(C, 3);
3550-
transmute(funnel_shl_u128(transmute(self), transmute(b), const { C as u128 }))
3539+
transmute(u128::funnel_shl(transmute(self), transmute(b), C))
35513540
}
35523541
}
35533542

0 commit comments

Comments
 (0)