Skip to content

Commit 80568d2

Browse files
authored
Merge pull request #347 from xangelix/fix-simd-lanes
Remove SIMD LaneCount, SupportedLaneCount with upstream changes
2 parents a96d4df + 817be47 commit 80568d2

4 files changed

Lines changed: 8 additions & 20 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- nightly
2222
# When changing this value don't forget to change the `package.rust-version` field in
2323
# `roaring/Cargo.toml`!!!
24-
- 1.82.0
24+
- 1.90.0
2525
env:
2626
RUSTFLAGS: "-C target-cpu=native -C opt-level=3"
2727

@@ -64,7 +64,7 @@ jobs:
6464
- stable
6565
- beta
6666
- nightly
67-
- 1.82.0
67+
- 1.90.0
6868
features:
6969
- default
7070
- no-std
@@ -98,7 +98,7 @@ jobs:
9898
run: cargo test -p roaring --features serde
9999

100100
- name: Test Benches
101-
if: matrix.rust != '1.82.0' && matrix.features == 'default'
101+
if: matrix.rust != '1.90.0' && matrix.features == 'default'
102102
run: cargo test -p benchmarks --benches
103103

104104
- name: Test no default features

roaring/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "roaring"
33
version = "0.11.3"
44
# When changing this value don't forget to change the MSRV test in `.github/workflows/test.yml`!!
5-
rust-version = "1.82.0"
5+
rust-version = "1.90.0"
66
authors = ["Wim Looman <wim@nemo157.com>", "Kerollmops <kero@meilisearch.com>"]
77
description = "A better compressed bitset - pure Rust implementation"
88

roaring/src/bitmap/inherent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl RoaringBitmap {
101101

102102
result
103103
}
104-
if offset % 8 != 0 {
104+
if !offset.is_multiple_of(8) {
105105
let shift = offset as usize % 8;
106106
let shifted_bytes = shift_bytes(bytes, shift);
107107
return RoaringBitmap::from_lsb0_bytes(offset - shift as u32, &shifted_bytes);

roaring/src/bitmap/store/array_store/vector.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212

1313
use super::scalar;
1414
use core::simd::cmp::{SimdPartialEq, SimdPartialOrd};
15-
use core::simd::{
16-
mask16x8, u16x8, u8x16, LaneCount, Mask, Simd, SimdElement, SupportedLaneCount, ToBytes,
17-
};
15+
use core::simd::{mask16x8, u16x8, u8x16, Mask, Select as _, Simd, SimdElement, ToBytes};
1816

1917
// a one-pass SSE union algorithm
2018
pub fn or(lhs: &[u16], rhs: &[u16], visitor: &mut impl BinaryOperationVisitor) {
@@ -360,10 +358,7 @@ pub fn sub(lhs: &[u16], rhs: &[u16], visitor: &mut impl BinaryOperationVisitor)
360358
fn lanes_min_u16<const LANES: usize>(
361359
lhs: Simd<u16, LANES>,
362360
rhs: Simd<u16, LANES>,
363-
) -> Simd<u16, LANES>
364-
where
365-
LaneCount<LANES>: SupportedLaneCount,
366-
{
361+
) -> Simd<u16, LANES> {
367362
lhs.simd_le(rhs).select(lhs, rhs)
368363
}
369364

@@ -372,18 +367,14 @@ where
372367
fn lanes_max_u16<const LANES: usize>(
373368
lhs: Simd<u16, LANES>,
374369
rhs: Simd<u16, LANES>,
375-
) -> Simd<u16, LANES>
376-
where
377-
LaneCount<LANES>: SupportedLaneCount,
378-
{
370+
) -> Simd<u16, LANES> {
379371
lhs.simd_gt(rhs).select(lhs, rhs)
380372
}
381373

382374
#[inline]
383375
pub fn load<U, const LANES: usize>(src: &[U]) -> Simd<U, LANES>
384376
where
385377
U: SimdElement + PartialOrd,
386-
LaneCount<LANES>: SupportedLaneCount,
387378
{
388379
debug_assert!(src.len() >= LANES);
389380
unsafe { load_unchecked(src) }
@@ -397,7 +388,6 @@ where
397388
pub unsafe fn load_unchecked<U, const LANES: usize>(src: &[U]) -> Simd<U, LANES>
398389
where
399390
U: SimdElement + PartialOrd,
400-
LaneCount<LANES>: SupportedLaneCount,
401391
{
402392
unsafe { core::ptr::read_unaligned(src as *const _ as *const Simd<U, LANES>) }
403393
}
@@ -407,7 +397,6 @@ where
407397
pub fn store<U, const LANES: usize>(v: Simd<U, LANES>, out: &mut [U])
408398
where
409399
U: SimdElement + PartialOrd,
410-
LaneCount<LANES>: SupportedLaneCount,
411400
{
412401
debug_assert!(out.len() >= LANES);
413402
unsafe {
@@ -423,7 +412,6 @@ where
423412
unsafe fn store_unchecked<U, const LANES: usize>(v: Simd<U, LANES>, out: &mut [U])
424413
where
425414
U: SimdElement + PartialOrd,
426-
LaneCount<LANES>: SupportedLaneCount,
427415
{
428416
unsafe { core::ptr::write_unaligned(out as *mut _ as *mut Simd<U, LANES>, v) }
429417
}

0 commit comments

Comments
 (0)