|
7 | 7 | // option. This file may not be copied, modified, or distributed |
8 | 8 | // except according to those terms. |
9 | 9 |
|
| 10 | +use any_all_workaround::all_mask16x8; |
| 11 | +use any_all_workaround::all_mask8x16; |
| 12 | +use any_all_workaround::any_mask16x8; |
| 13 | +use any_all_workaround::any_mask8x16; |
10 | 14 | use core::simd::cmp::SimdPartialEq; |
11 | 15 | use core::simd::cmp::SimdPartialOrd; |
| 16 | +use core::simd::mask16x8; |
| 17 | +use core::simd::mask8x16; |
12 | 18 | use core::simd::simd_swizzle; |
13 | 19 | use core::simd::u16x8; |
14 | 20 | use core::simd::u8x16; |
15 | | -use core::simd::mask16x8; |
16 | | -use core::simd::mask8x16; |
17 | 21 | use core::simd::ToBytes; |
18 | | -use any_all_workaround::all_mask8x16; |
19 | | -use any_all_workaround::any_mask8x16; |
20 | | -use any_all_workaround::all_mask16x8; |
21 | | -use any_all_workaround::any_mask16x8; |
22 | 22 |
|
23 | 23 | // TODO: Migrate unaligned access to stdlib code if/when the RFC |
24 | 24 | // https://github.com/rust-lang/rfcs/pull/1725 is implemented. |
@@ -225,7 +225,7 @@ cfg_if! { |
225 | 225 | // seems faster in this case while the above |
226 | 226 | // function is better the other way round... |
227 | 227 | let highest_latin1 = u16x8::splat(0xFF); |
228 | | - any_mask16x8(!s.simd_gt(highest_latin1)) |
| 228 | + !any_mask16x8(s.simd_gt(highest_latin1)) |
229 | 229 | } |
230 | 230 | } |
231 | 231 | } |
@@ -289,21 +289,25 @@ pub fn is_u16x8_bidi(s: u16x8) -> bool { |
289 | 289 |
|
290 | 290 | non_aarch64_return_false_if_all!(below_hebrew); |
291 | 291 |
|
292 | | - if all_mask16x8(below_hebrew | in_range16x8!(s, 0x0900, 0x200F) | in_range16x8!(s, 0x2068, 0xD802)) { |
| 292 | + if all_mask16x8( |
| 293 | + below_hebrew | in_range16x8!(s, 0x0900, 0x200F) | in_range16x8!(s, 0x2068, 0xD802), |
| 294 | + ) { |
293 | 295 | return false; |
294 | 296 | } |
295 | 297 |
|
296 | 298 | // Quick refutation failed. Let's do the full check. |
297 | 299 |
|
298 | | - any_mask16x8((in_range16x8!(s, 0x0590, 0x0900) |
299 | | - | in_range16x8!(s, 0xFB1D, 0xFE00) |
300 | | - | in_range16x8!(s, 0xFE70, 0xFEFF) |
301 | | - | in_range16x8!(s, 0xD802, 0xD804) |
302 | | - | in_range16x8!(s, 0xD83A, 0xD83C) |
303 | | - | s.simd_eq(u16x8::splat(0x200F)) |
304 | | - | s.simd_eq(u16x8::splat(0x202B)) |
305 | | - | s.simd_eq(u16x8::splat(0x202E)) |
306 | | - | s.simd_eq(u16x8::splat(0x2067)))) |
| 300 | + any_mask16x8( |
| 301 | + (in_range16x8!(s, 0x0590, 0x0900) |
| 302 | + | in_range16x8!(s, 0xFB1D, 0xFE00) |
| 303 | + | in_range16x8!(s, 0xFE70, 0xFEFF) |
| 304 | + | in_range16x8!(s, 0xD802, 0xD804) |
| 305 | + | in_range16x8!(s, 0xD83A, 0xD83C) |
| 306 | + | s.simd_eq(u16x8::splat(0x200F)) |
| 307 | + | s.simd_eq(u16x8::splat(0x202B)) |
| 308 | + | s.simd_eq(u16x8::splat(0x202E)) |
| 309 | + | s.simd_eq(u16x8::splat(0x2067))), |
| 310 | + ) |
307 | 311 | } |
308 | 312 |
|
309 | 313 | #[inline(always)] |
|
0 commit comments