From 6d0423808916f05c0a2bf5588178ecc224cad912 Mon Sep 17 00:00:00 2001 From: Mike Aizatsky Date: Fri, 25 Oct 2024 21:33:45 -0700 Subject: [PATCH] rename --- src/cards.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/cards.rs b/src/cards.rs index 1c7a15e..4863a01 100644 --- a/src/cards.rs +++ b/src/cards.rs @@ -1,7 +1,7 @@ use std::{ fmt::Write, ops::{Shl, Shr}, - simd::{num::SimdUint, Simd}, + simd::{num::SimdUint, u64x4, Simd}, }; use regex::Regex; @@ -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] @@ -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) } } @@ -740,13 +740,10 @@ impl From for CardSet { } } -// WNES order -type Hands = Simd; - /// 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); @@ -812,7 +809,7 @@ impl Deal { } #[inline] - fn promote_suit(hands: &mut Hands, present: u64) { + fn promote_suit(hands: &mut u64x4, present: u64) { let present = present & SUIT_MASK; if present == 0 { // empty suit, nothing to promote