diff --git a/crates/core_simd/src/macros.rs b/crates/core_simd/src/macros.rs index 33541899ca3..591a85af08f 100644 --- a/crates/core_simd/src/macros.rs +++ b/crates/core_simd/src/macros.rs @@ -135,57 +135,6 @@ macro_rules! call_counting_args { }; } -/// Calls the macro `$mac` with the specified `$args` followed by counting values from 0 to the -/// specified value. -macro_rules! call_counting_values { - { 1 => $mac:path => $($args:tt)* } => { - $mac! { - $($args)* - 0 - } - }; - { 2 => $mac:path => $($args:tt)* } => { - $mac! { - $($args)* - 0 1 - } - }; - { 4 => $mac:path => $($args:tt)* } => { - $mac! { - $($args)* - 0 1 2 3 - } - }; - { 8 => $mac:path => $($args:tt)* } => { - $mac! { - $($args)* - 0 1 2 3 4 5 6 7 - } - }; - { 16 => $mac:path => $($args:tt)* } => { - $mac! { - $($args)* - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - } - }; - { 32 => $mac:path => $($args:tt)* } => { - $mac! { - $($args)* - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 - } - }; - { 64 => $mac:path => $($args:tt)* } => { - $mac! { - $($args)* - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 - 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 - 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 - } - }; -} - /// Implements common traits on the specified vector `$name`, holding multiple `$lanes` of `$type`. macro_rules! base_vector_traits { { $name:path => [$type:ty; $lanes:literal] } => { diff --git a/crates/core_simd/src/pointers.rs b/crates/core_simd/src/pointers.rs index a7c514aae7a..4c20eab9920 100644 --- a/crates/core_simd/src/pointers.rs +++ b/crates/core_simd/src/pointers.rs @@ -9,6 +9,17 @@ macro_rules! define_pointer_vector { #[repr(C)] pub struct $name($underlying, PhantomData); + impl core::fmt::Debug for $name { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + crate::fmt::format(self.as_ref(), f) + } + } + impl core::fmt::Pointer for $name { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + crate::fmt::format_pointer(self.as_ref(), f) + } + } + impl Copy for $name {} impl Clone for $name { @@ -40,8 +51,6 @@ macro_rules! define_pointer_vector { } } - call_counting_values! { $lanes => define_pointer_vector => debug $name | *$mut T | } - impl $name { /// Construct a vector by setting all lanes to the given value. #[inline] @@ -97,18 +106,6 @@ macro_rules! define_pointer_vector { Self(<$underlying>::new($($var as isize),*), PhantomData) } }; - { debug $name:ident | $type:ty | $($index:tt)* } => { - impl core::fmt::Debug for $name { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - crate::fmt::format(self.as_ref(), f) - } - } - impl core::fmt::Pointer for $name { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - crate::fmt::format_pointer(self.as_ref(), f) - } - } - } } define_pointer_vector! { #[doc = "Vector of two mutable pointers"] mptrx2 => isizex2 => 2, mut }