Remove some obsolete macros

This commit is contained in:
Caleb Zulawski 2020-09-25 00:52:32 -04:00
parent b7d1f3e797
commit 2178409df5
2 changed files with 11 additions and 65 deletions

View file

@ -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] } => {

View file

@ -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 }