Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
mikea committed Oct 26, 2024
1 parent 776060c commit 6d04238
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/cards.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{
fmt::Write,
ops::{Shl, Shr},
simd::{num::SimdUint, Simd},
simd::{num::SimdUint, u64x4, Simd},
};

use regex::Regex;
Expand Down Expand Up @@ -571,7 +571,7 @@ impl CardSet {

// order of Suit values
const SUITS: [CardSet; 4] = [Self::C, Self::D, Self::H, Self::S];
const SUIT_MASKS: Hands =
const SUIT_MASKS: u64x4 =
Simd::from_array([Self::C.mask, Self::D.mask, Self::H.mask, Self::S.mask]);

#[must_use]
Expand Down Expand Up @@ -707,7 +707,7 @@ impl CardSet {
ones.leading_ones() as u8 - suit.mask.leading_zeros() as u8
}

fn splat(self) -> Hands {
fn splat(self) -> u64x4 {
Simd::splat(self.mask)
}
}
Expand Down Expand Up @@ -740,13 +740,10 @@ impl From<u64> for CardSet {
}
}

// WNES order
type Hands = Simd<u64, 4>;

/// A distribution of cards across 4 players.
#[derive(Clone, Eq, PartialEq, Hash)]
pub struct Deal {
hands: Hands,
hands: u64x4,
}
assert_eq_size!([u64; 4], Deal);

Expand Down Expand Up @@ -812,7 +809,7 @@ impl Deal {
}

#[inline]
fn promote_suit<const SUIT_MASK: u64>(hands: &mut Hands, present: u64) {
fn promote_suit<const SUIT_MASK: u64>(hands: &mut u64x4, present: u64) {
let present = present & SUIT_MASK;
if present == 0 {
// empty suit, nothing to promote
Expand Down

0 comments on commit 6d04238

Please sign in to comment.