Skip to content

Commit 598edc8

Browse files
committed
Port from packed_simd crate to portable_simd feature (aarch64 part)
1 parent 2d198c8 commit 598edc8

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/simd_funcs.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ cfg_if! {
148148
pub fn simd_is_ascii(s: u8x16) -> bool {
149149
unsafe {
150150
// Safety: We have cfg()d the correct platform
151-
vmaxvq_u8(s.into_bits()) < 0x80
151+
vmaxvq_u8(s.into()) < 0x80
152152
}
153153
}
154154
} else {
@@ -177,7 +177,7 @@ cfg_if! {
177177
pub fn simd_is_str_latin1(s: u8x16) -> bool {
178178
unsafe {
179179
// Safety: We have cfg()d the correct platform
180-
vmaxvq_u8(s.into_bits()) < 0xC4
180+
vmaxvq_u8(s.into()) < 0xC4
181181
}
182182
}
183183
} else {
@@ -195,15 +195,15 @@ cfg_if! {
195195
pub fn simd_is_basic_latin(s: u16x8) -> bool {
196196
unsafe {
197197
// Safety: We have cfg()d the correct platform
198-
vmaxvq_u16(s.into_bits()) < 0x80
198+
vmaxvq_u16(s.into()) < 0x80
199199
}
200200
}
201201

202202
#[inline(always)]
203203
pub fn simd_is_latin1(s: u16x8) -> bool {
204204
unsafe {
205205
// Safety: We have cfg()d the correct platform
206-
vmaxvq_u16(s.into_bits()) < 0x100
206+
vmaxvq_u16(s.into()) < 0x100
207207
}
208208
}
209209
} else {
@@ -237,7 +237,7 @@ cfg_if! {
237237
($s:ident) => ({
238238
unsafe {
239239
// Safety: We have cfg()d the correct platform
240-
if vmaxvq_u16($s.into_bits()) < 0x0590 {
240+
if vmaxvq_u16($s.into()) < 0x0590 {
241241
return false;
242242
}
243243
}
@@ -328,9 +328,9 @@ cfg_if! {
328328
} else {
329329
#[inline(always)]
330330
pub fn simd_pack(a: u16x8, b: u16x8) -> u8x16 {
331-
let first: u8x16 = a.into_bits();
332-
let second: u8x16 = b.into_bits();
333-
shuffle!(
331+
let first: u8x16 = a.to_ne_bytes();
332+
let second: u8x16 = b.to_ne_bytes();
333+
simd_swizzle!(
334334
first,
335335
second,
336336
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]

0 commit comments

Comments
 (0)