1
1
use crate :: simd:: intrinsics;
2
2
use crate :: simd:: { LaneCount , Simd , SimdElement , SupportedLaneCount } ;
3
+ use core:: ops:: { Add , Mul } ;
4
+ use core:: ops:: { BitAnd , BitOr , BitXor } ;
5
+ use core:: ops:: { Div , Rem , Sub } ;
6
+ use core:: ops:: { Shl , Shr } ;
7
+
8
+ mod deref;
3
9
4
10
impl < I , T , const LANES : usize > core:: ops:: Index < I > for Simd < T , LANES >
5
11
where
@@ -57,42 +63,6 @@ macro_rules! impl_ref_ops {
57
63
$( #[ $attrs] ) *
58
64
fn $fn( $self_tok, $rhs_arg: $rhs_arg_ty) -> Self :: Output $body
59
65
}
60
-
61
- impl <const $lanes: usize > core:: ops:: $trait<& ' _ $rhs> for $type
62
- where
63
- LaneCount <$lanes2>: SupportedLaneCount ,
64
- {
65
- type Output = <$type as core:: ops:: $trait<$rhs>>:: Output ;
66
-
67
- $( #[ $attrs] ) *
68
- fn $fn( $self_tok, $rhs_arg: & $rhs) -> Self :: Output {
69
- core:: ops:: $trait:: $fn( $self_tok, * $rhs_arg)
70
- }
71
- }
72
-
73
- impl <const $lanes: usize > core:: ops:: $trait<$rhs> for & ' _ $type
74
- where
75
- LaneCount <$lanes2>: SupportedLaneCount ,
76
- {
77
- type Output = <$type as core:: ops:: $trait<$rhs>>:: Output ;
78
-
79
- $( #[ $attrs] ) *
80
- fn $fn( $self_tok, $rhs_arg: $rhs) -> Self :: Output {
81
- core:: ops:: $trait:: $fn( * $self_tok, $rhs_arg)
82
- }
83
- }
84
-
85
- impl <const $lanes: usize > core:: ops:: $trait<& ' _ $rhs> for & ' _ $type
86
- where
87
- LaneCount <$lanes2>: SupportedLaneCount ,
88
- {
89
- type Output = <$type as core:: ops:: $trait<$rhs>>:: Output ;
90
-
91
- $( #[ $attrs] ) *
92
- fn $fn( $self_tok, $rhs_arg: & $rhs) -> Self :: Output {
93
- core:: ops:: $trait:: $fn( * $self_tok, * $rhs_arg)
94
- }
95
- }
96
66
} ;
97
67
98
68
// binary assignment op
@@ -112,16 +82,6 @@ macro_rules! impl_ref_ops {
112
82
$( #[ $attrs] ) *
113
83
fn $fn( & mut $self_tok, $rhs_arg: $rhs_arg_ty) $body
114
84
}
115
-
116
- impl <const $lanes: usize > core:: ops:: $trait<& ' _ $rhs> for $type
117
- where
118
- LaneCount <$lanes2>: SupportedLaneCount ,
119
- {
120
- $( #[ $attrs] ) *
121
- fn $fn( & mut $self_tok, $rhs_arg: & $rhs_arg_ty) {
122
- core:: ops:: $trait:: $fn( $self_tok, * $rhs_arg)
123
- }
124
- }
125
85
} ;
126
86
127
87
// unary op
@@ -141,16 +101,6 @@ macro_rules! impl_ref_ops {
141
101
type Output = $output;
142
102
fn $fn( $self_tok) -> Self :: Output $body
143
103
}
144
-
145
- impl <const $lanes: usize > core:: ops:: $trait for & ' _ $type
146
- where
147
- LaneCount <$lanes2>: SupportedLaneCount ,
148
- {
149
- type Output = <$type as core:: ops:: $trait>:: Output ;
150
- fn $fn( $self_tok) -> Self :: Output {
151
- core:: ops:: $trait:: $fn( * $self_tok)
152
- }
153
- }
154
104
}
155
105
}
156
106
0 commit comments