diff options
| author | Caleb Zulawski <caleb.zulawski@gmail.com> | 2020-09-25 00:52:32 -0400 |
|---|---|---|
| committer | Caleb Zulawski <caleb.zulawski@gmail.com> | 2020-09-25 00:52:32 -0400 |
| commit | 2178409df574aa83c5e9e6e7bff62b66c32acf63 (patch) | |
| tree | 430dcfc954b78495eedee0c3114de50e349d9ac0 | |
| parent | b7d1f3e797fbb12059203a640adce59f2a359dc4 (diff) | |
| download | rust-2178409df574aa83c5e9e6e7bff62b66c32acf63.tar.gz rust-2178409df574aa83c5e9e6e7bff62b66c32acf63.zip | |
Remove some obsolete macros
| -rw-r--r-- | crates/core_simd/src/macros.rs | 51 | ||||
| -rw-r--r-- | crates/core_simd/src/pointers.rs | 25 |
2 files changed, 11 insertions, 65 deletions
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<T>($underlying, PhantomData<T>); + impl<T> core::fmt::Debug for $name<T> { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + crate::fmt::format(self.as_ref(), f) + } + } + impl<T> core::fmt::Pointer for $name<T> { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + crate::fmt::format_pointer(self.as_ref(), f) + } + } + impl<T> Copy for $name<T> {} impl<T> Clone for $name<T> { @@ -40,8 +51,6 @@ macro_rules! define_pointer_vector { } } - call_counting_values! { $lanes => define_pointer_vector => debug $name | *$mut T | } - impl<T> $name<T> { /// 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<T> core::fmt::Debug for $name<T> { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - crate::fmt::format(self.as_ref(), f) - } - } - impl<T> core::fmt::Pointer for $name<T> { - 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 } |
