Skip to content

Commit 8bcba0b

Browse files
committed
Move a negation to the right place and cargo fmt
1 parent 29668e3 commit 8bcba0b

1 file changed

Lines changed: 21 additions & 17 deletions

File tree

src/simd_funcs.rs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

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;
1014
use core::simd::cmp::SimdPartialEq;
1115
use core::simd::cmp::SimdPartialOrd;
16+
use core::simd::mask16x8;
17+
use core::simd::mask8x16;
1218
use core::simd::simd_swizzle;
1319
use core::simd::u16x8;
1420
use core::simd::u8x16;
15-
use core::simd::mask16x8;
16-
use core::simd::mask8x16;
1721
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;
2222

2323
// TODO: Migrate unaligned access to stdlib code if/when the RFC
2424
// https://github.com/rust-lang/rfcs/pull/1725 is implemented.
@@ -225,7 +225,7 @@ cfg_if! {
225225
// seems faster in this case while the above
226226
// function is better the other way round...
227227
let highest_latin1 = u16x8::splat(0xFF);
228-
any_mask16x8(!s.simd_gt(highest_latin1))
228+
!any_mask16x8(s.simd_gt(highest_latin1))
229229
}
230230
}
231231
}
@@ -289,21 +289,25 @@ pub fn is_u16x8_bidi(s: u16x8) -> bool {
289289

290290
non_aarch64_return_false_if_all!(below_hebrew);
291291

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+
) {
293295
return false;
294296
}
295297

296298
// Quick refutation failed. Let's do the full check.
297299

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+
)
307311
}
308312

309313
#[inline(always)]

0 commit comments

Comments
 (0)