Skip to content

Commit 2178409

Browse files
committed
Remove some obsolete macros
1 parent b7d1f3e commit 2178409

File tree

2 files changed

+11
-65
lines changed

2 files changed

+11
-65
lines changed

crates/core_simd/src/macros.rs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -135,57 +135,6 @@ macro_rules! call_counting_args {
135135
};
136136
}
137137

138-
/// Calls the macro `$mac` with the specified `$args` followed by counting values from 0 to the
139-
/// specified value.
140-
macro_rules! call_counting_values {
141-
{ 1 => $mac:path => $($args:tt)* } => {
142-
$mac! {
143-
$($args)*
144-
0
145-
}
146-
};
147-
{ 2 => $mac:path => $($args:tt)* } => {
148-
$mac! {
149-
$($args)*
150-
0 1
151-
}
152-
};
153-
{ 4 => $mac:path => $($args:tt)* } => {
154-
$mac! {
155-
$($args)*
156-
0 1 2 3
157-
}
158-
};
159-
{ 8 => $mac:path => $($args:tt)* } => {
160-
$mac! {
161-
$($args)*
162-
0 1 2 3 4 5 6 7
163-
}
164-
};
165-
{ 16 => $mac:path => $($args:tt)* } => {
166-
$mac! {
167-
$($args)*
168-
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
169-
}
170-
};
171-
{ 32 => $mac:path => $($args:tt)* } => {
172-
$mac! {
173-
$($args)*
174-
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
175-
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
176-
}
177-
};
178-
{ 64 => $mac:path => $($args:tt)* } => {
179-
$mac! {
180-
$($args)*
181-
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
182-
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
183-
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
184-
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
185-
}
186-
};
187-
}
188-
189138
/// Implements common traits on the specified vector `$name`, holding multiple `$lanes` of `$type`.
190139
macro_rules! base_vector_traits {
191140
{ $name:path => [$type:ty; $lanes:literal] } => {

crates/core_simd/src/pointers.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ macro_rules! define_pointer_vector {
99
#[repr(C)]
1010
pub struct $name<T>($underlying, PhantomData<T>);
1111

12+
impl<T> core::fmt::Debug for $name<T> {
13+
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
14+
crate::fmt::format(self.as_ref(), f)
15+
}
16+
}
17+
impl<T> core::fmt::Pointer for $name<T> {
18+
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
19+
crate::fmt::format_pointer(self.as_ref(), f)
20+
}
21+
}
22+
1223
impl<T> Copy for $name<T> {}
1324

1425
impl<T> Clone for $name<T> {
@@ -40,8 +51,6 @@ macro_rules! define_pointer_vector {
4051
}
4152
}
4253

43-
call_counting_values! { $lanes => define_pointer_vector => debug $name | *$mut T | }
44-
4554
impl<T> $name<T> {
4655
/// Construct a vector by setting all lanes to the given value.
4756
#[inline]
@@ -97,18 +106,6 @@ macro_rules! define_pointer_vector {
97106
Self(<$underlying>::new($($var as isize),*), PhantomData)
98107
}
99108
};
100-
{ debug $name:ident | $type:ty | $($index:tt)* } => {
101-
impl<T> core::fmt::Debug for $name<T> {
102-
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
103-
crate::fmt::format(self.as_ref(), f)
104-
}
105-
}
106-
impl<T> core::fmt::Pointer for $name<T> {
107-
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
108-
crate::fmt::format_pointer(self.as_ref(), f)
109-
}
110-
}
111-
}
112109
}
113110

114111
define_pointer_vector! { #[doc = "Vector of two mutable pointers"] mptrx2 => isizex2 => 2, mut }

0 commit comments

Comments
 (0)