Skip to content

Commit 1e5a21d

Browse files
committed
Move vector combine intrisics to arm/neon.rs
1 parent c3b6820 commit 1e5a21d

File tree

2 files changed

+157
-129
lines changed

2 files changed

+157
-129
lines changed

crates/core_arch/src/aarch64/neon/mod.rs

Lines changed: 0 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,94 +1964,6 @@ pub unsafe fn vext_f64<const N: i32>(a: float64x1_t, _b: float64x1_t) -> float64
19641964
static_assert!(N : i32 where N == 0);
19651965
a
19661966
}
1967-
/// Vector combine
1968-
#[inline]
1969-
#[target_feature(enable = "neon")]
1970-
#[cfg_attr(test, assert_instr(mov))]
1971-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
1972-
pub unsafe fn vcombine_s8(low: int8x8_t, high: int8x8_t) -> int8x16_t {
1973-
simd_shuffle16!(
1974-
low,
1975-
high,
1976-
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
1977-
)
1978-
}
1979-
1980-
/// Vector combine
1981-
#[inline]
1982-
#[target_feature(enable = "neon")]
1983-
#[cfg_attr(test, assert_instr(mov))]
1984-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
1985-
pub unsafe fn vcombine_s16(low: int16x4_t, high: int16x4_t) -> int16x8_t {
1986-
simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
1987-
}
1988-
1989-
/// Vector combine
1990-
#[inline]
1991-
#[target_feature(enable = "neon")]
1992-
#[cfg_attr(test, assert_instr(mov))]
1993-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
1994-
pub unsafe fn vcombine_s32(low: int32x2_t, high: int32x2_t) -> int32x4_t {
1995-
simd_shuffle4!(low, high, [0, 1, 2, 3])
1996-
}
1997-
1998-
/// Vector combine
1999-
#[inline]
2000-
#[target_feature(enable = "neon")]
2001-
#[cfg_attr(test, assert_instr(mov))]
2002-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2003-
pub unsafe fn vcombine_s64(low: int64x1_t, high: int64x1_t) -> int64x2_t {
2004-
simd_shuffle2!(low, high, [0, 1])
2005-
}
2006-
2007-
/// Vector combine
2008-
#[inline]
2009-
#[target_feature(enable = "neon")]
2010-
#[cfg_attr(test, assert_instr(mov))]
2011-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2012-
pub unsafe fn vcombine_u8(low: uint8x8_t, high: uint8x8_t) -> uint8x16_t {
2013-
simd_shuffle16!(
2014-
low,
2015-
high,
2016-
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
2017-
)
2018-
}
2019-
2020-
/// Vector combine
2021-
#[inline]
2022-
#[target_feature(enable = "neon")]
2023-
#[cfg_attr(test, assert_instr(mov))]
2024-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2025-
pub unsafe fn vcombine_u16(low: uint16x4_t, high: uint16x4_t) -> uint16x8_t {
2026-
simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
2027-
}
2028-
2029-
/// Vector combine
2030-
#[inline]
2031-
#[target_feature(enable = "neon")]
2032-
#[cfg_attr(test, assert_instr(mov))]
2033-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2034-
pub unsafe fn vcombine_u32(low: uint32x2_t, high: uint32x2_t) -> uint32x4_t {
2035-
simd_shuffle4!(low, high, [0, 1, 2, 3])
2036-
}
2037-
2038-
/// Vector combine
2039-
#[inline]
2040-
#[target_feature(enable = "neon")]
2041-
#[cfg_attr(test, assert_instr(mov))]
2042-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2043-
pub unsafe fn vcombine_u64(low: uint64x1_t, high: uint64x1_t) -> uint64x2_t {
2044-
simd_shuffle2!(low, high, [0, 1])
2045-
}
2046-
2047-
/// Vector combine
2048-
#[inline]
2049-
#[target_feature(enable = "neon")]
2050-
#[cfg_attr(test, assert_instr(mov))]
2051-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2052-
pub unsafe fn vcombine_p64(low: poly64x1_t, high: poly64x1_t) -> poly64x2_t {
2053-
simd_shuffle2!(low, high, [0, 1])
2054-
}
20551967

20561968
/// Duplicate vector element to vector or scalar
20571969
#[inline]
@@ -2183,47 +2095,6 @@ pub unsafe fn vgetq_lane_f64<const IMM5: i32>(v: float64x2_t) -> f64 {
21832095
simd_extract(v, IMM5 as u32)
21842096
}
21852097

2186-
/* FIXME: 16-bit float
2187-
/// Vector combine
2188-
#[inline]
2189-
#[target_feature(enable = "neon")]
2190-
#[cfg_attr(test, assert_instr(mov))]
2191-
pub unsafe fn vcombine_f16 ( low: float16x4_t, high: float16x4_t) -> float16x8_t {
2192-
simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
2193-
}
2194-
*/
2195-
2196-
/// Vector combine
2197-
#[inline]
2198-
#[target_feature(enable = "neon")]
2199-
#[cfg_attr(test, assert_instr(mov))]
2200-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2201-
pub unsafe fn vcombine_f32(low: float32x2_t, high: float32x2_t) -> float32x4_t {
2202-
simd_shuffle4!(low, high, [0, 1, 2, 3])
2203-
}
2204-
2205-
/// Vector combine
2206-
#[inline]
2207-
#[target_feature(enable = "neon")]
2208-
#[cfg_attr(test, assert_instr(mov))]
2209-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2210-
pub unsafe fn vcombine_p8(low: poly8x8_t, high: poly8x8_t) -> poly8x16_t {
2211-
simd_shuffle16!(
2212-
low,
2213-
high,
2214-
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
2215-
)
2216-
}
2217-
2218-
/// Vector combine
2219-
#[inline]
2220-
#[target_feature(enable = "neon")]
2221-
#[cfg_attr(test, assert_instr(mov))]
2222-
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2223-
pub unsafe fn vcombine_p16(low: poly16x4_t, high: poly16x4_t) -> poly16x8_t {
2224-
simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
2225-
}
2226-
22272098
/// Vector combine
22282099
#[inline]
22292100
#[target_feature(enable = "neon")]

crates/core_arch/src/arm_shared/neon/mod.rs

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6915,6 +6915,163 @@ pub unsafe fn vusmmlaq_s32(a: int32x4_t, b: uint8x16_t, c: int8x16_t) -> int32x4
69156915
vusmmlaq_s32_(a, b, c)
69166916
}
69176917

6918+
/* FIXME: 16-bit float
6919+
/// Vector combine
6920+
#[inline]
6921+
#[target_feature(enable = "neon")]
6922+
#[cfg_attr(test, assert_instr(mov))]
6923+
pub unsafe fn vcombine_f16 ( low: float16x4_t, high: float16x4_t) -> float16x8_t {
6924+
simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
6925+
}
6926+
*/
6927+
6928+
/// Vector combine
6929+
#[inline]
6930+
#[target_feature(enable = "neon")]
6931+
#[cfg_attr(test, assert_instr(mov))]
6932+
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
6933+
pub unsafe fn vcombine_f32(low: float32x2_t, high: float32x2_t) -> float32x4_t {
6934+
simd_shuffle4!(low, high, [0, 1, 2, 3])
6935+
}
6936+
6937+
/// Vector combine
6938+
#[inline]
6939+
#[target_feature(enable = "neon")]
6940+
#[cfg_attr(test, assert_instr(mov))]
6941+
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
6942+
pub unsafe fn vcombine_p8(low: poly8x8_t, high: poly8x8_t) -> poly8x16_t {
6943+
simd_shuffle16!(
6944+
low,
6945+
high,
6946+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
6947+
)
6948+
}
6949+
6950+
/// Vector combine
6951+
#[inline]
6952+
#[target_feature(enable = "neon")]
6953+
#[cfg_attr(test, assert_instr(mov))]
6954+
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
6955+
pub unsafe fn vcombine_p16(low: poly16x4_t, high: poly16x4_t) -> poly16x8_t {
6956+
simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
6957+
}
6958+
6959+
/// Vector combine
6960+
#[inline]
6961+
#[target_feature(enable = "neon,v7")]
6962+
#[cfg_attr(test, assert_instr(mov))]
6963+
#[cfg_attr(
6964+
target_arch = "aarch64",
6965+
stable(feature = "neon_intrinsics", since = "1.59.0")
6966+
)]
6967+
pub unsafe fn vcombine_s8(low: int8x8_t, high: int8x8_t) -> int8x16_t {
6968+
simd_shuffle16!(
6969+
low,
6970+
high,
6971+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
6972+
)
6973+
}
6974+
6975+
/// Vector combine
6976+
#[inline]
6977+
#[target_feature(enable = "neon,v7")]
6978+
#[cfg_attr(test, assert_instr(mov))]
6979+
#[cfg_attr(
6980+
target_arch = "aarch64",
6981+
stable(feature = "neon_intrinsics", since = "1.59.0")
6982+
)]
6983+
pub unsafe fn vcombine_s16(low: int16x4_t, high: int16x4_t) -> int16x8_t {
6984+
simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
6985+
}
6986+
6987+
/// Vector combine
6988+
#[inline]
6989+
#[target_feature(enable = "neon,v7")]
6990+
#[cfg_attr(test, assert_instr(mov))]
6991+
#[cfg_attr(
6992+
target_arch = "aarch64",
6993+
stable(feature = "neon_intrinsics", since = "1.59.0")
6994+
)]
6995+
pub unsafe fn vcombine_s32(low: int32x2_t, high: int32x2_t) -> int32x4_t {
6996+
simd_shuffle4!(low, high, [0, 1, 2, 3])
6997+
}
6998+
6999+
/// Vector combine
7000+
#[inline]
7001+
#[target_feature(enable = "neon,v7")]
7002+
#[cfg_attr(test, assert_instr(mov))]
7003+
#[cfg_attr(
7004+
target_arch = "aarch64",
7005+
stable(feature = "neon_intrinsics", since = "1.59.0")
7006+
)]
7007+
pub unsafe fn vcombine_s64(low: int64x1_t, high: int64x1_t) -> int64x2_t {
7008+
simd_shuffle2!(low, high, [0, 1])
7009+
}
7010+
7011+
/// Vector combine
7012+
#[inline]
7013+
#[target_feature(enable = "neon,v7")]
7014+
#[cfg_attr(test, assert_instr(mov))]
7015+
#[cfg_attr(
7016+
target_arch = "aarch64",
7017+
stable(feature = "neon_intrinsics", since = "1.59.0")
7018+
)]
7019+
pub unsafe fn vcombine_u8(low: uint8x8_t, high: uint8x8_t) -> uint8x16_t {
7020+
simd_shuffle16!(
7021+
low,
7022+
high,
7023+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
7024+
)
7025+
}
7026+
7027+
/// Vector combine
7028+
#[inline]
7029+
#[target_feature(enable = "neon,v7")]
7030+
#[cfg_attr(test, assert_instr(mov))]
7031+
#[cfg_attr(
7032+
target_arch = "aarch64",
7033+
stable(feature = "neon_intrinsics", since = "1.59.0")
7034+
)]
7035+
pub unsafe fn vcombine_u16(low: uint16x4_t, high: uint16x4_t) -> uint16x8_t {
7036+
simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
7037+
}
7038+
7039+
/// Vector combine
7040+
#[inline]
7041+
#[target_feature(enable = "neon,v7")]
7042+
#[cfg_attr(test, assert_instr(mov))]
7043+
#[cfg_attr(
7044+
target_arch = "aarch64",
7045+
stable(feature = "neon_intrinsics", since = "1.59.0")
7046+
)]
7047+
pub unsafe fn vcombine_u32(low: uint32x2_t, high: uint32x2_t) -> uint32x4_t {
7048+
simd_shuffle4!(low, high, [0, 1, 2, 3])
7049+
}
7050+
7051+
/// Vector combine
7052+
#[inline]
7053+
#[target_feature(enable = "neon,v7")]
7054+
#[cfg_attr(test, assert_instr(mov))]
7055+
#[cfg_attr(
7056+
target_arch = "aarch64",
7057+
stable(feature = "neon_intrinsics", since = "1.59.0")
7058+
)]
7059+
pub unsafe fn vcombine_u64(low: uint64x1_t, high: uint64x1_t) -> uint64x2_t {
7060+
simd_shuffle2!(low, high, [0, 1])
7061+
}
7062+
7063+
/// Vector combine
7064+
#[inline]
7065+
#[target_feature(enable = "neon,v7")]
7066+
#[cfg_attr(test, assert_instr(mov))]
7067+
#[cfg_attr(
7068+
target_arch = "aarch64",
7069+
stable(feature = "neon_intrinsics", since = "1.59.0")
7070+
)]
7071+
pub unsafe fn vcombine_p64(low: poly64x1_t, high: poly64x1_t) -> poly64x2_t {
7072+
simd_shuffle2!(low, high, [0, 1])
7073+
}
7074+
69187075
#[cfg(test)]
69197076
mod tests {
69207077
use super::*;

0 commit comments

Comments
 (0)