11use crate :: simd:: intrinsics;
22use 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;
39
410impl < I , T , const LANES : usize > core:: ops:: Index < I > for Simd < T , LANES >
511where
@@ -57,42 +63,6 @@ macro_rules! impl_ref_ops {
5763 $( #[ $attrs] ) *
5864 fn $fn( $self_tok, $rhs_arg: $rhs_arg_ty) -> Self :: Output $body
5965 }
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- }
9666 } ;
9767
9868 // binary assignment op
@@ -112,16 +82,6 @@ macro_rules! impl_ref_ops {
11282 $( #[ $attrs] ) *
11383 fn $fn( & mut $self_tok, $rhs_arg: $rhs_arg_ty) $body
11484 }
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- }
12585 } ;
12686
12787 // unary op
@@ -141,16 +101,6 @@ macro_rules! impl_ref_ops {
141101 type Output = $output;
142102 fn $fn( $self_tok) -> Self :: Output $body
143103 }
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- }
154104 }
155105}
156106
0 commit comments