@@ -118,34 +118,6 @@ macro_rules! impl_op {
118
118
}
119
119
}
120
120
}
121
-
122
- impl_ref_ops! {
123
- impl <const LANES : usize > core:: ops:: $trait<$scalar> for Simd <$scalar, LANES >
124
- where
125
- LaneCount <LANES >: SupportedLaneCount ,
126
- {
127
- type Output = Self ;
128
-
129
- #[ inline]
130
- fn $trait_fn( self , rhs: $scalar) -> Self :: Output {
131
- core:: ops:: $trait:: $trait_fn( self , Self :: splat( rhs) )
132
- }
133
- }
134
- }
135
-
136
- impl_ref_ops! {
137
- impl <const LANES : usize > core:: ops:: $trait<Simd <$scalar, LANES >> for $scalar
138
- where
139
- LaneCount <LANES >: SupportedLaneCount ,
140
- {
141
- type Output = Simd <$scalar, LANES >;
142
-
143
- #[ inline]
144
- fn $trait_fn( self , rhs: Simd <$scalar, LANES >) -> Self :: Output {
145
- core:: ops:: $trait:: $trait_fn( Simd :: splat( self ) , rhs)
146
- }
147
- }
148
- }
149
121
} ;
150
122
}
151
123
@@ -202,43 +174,6 @@ macro_rules! impl_unsigned_int_ops {
202
174
}
203
175
}
204
176
205
- impl_ref_ops! {
206
- impl <const LANES : usize > core:: ops:: Div <$scalar> for Simd <$scalar, LANES >
207
- where
208
- LaneCount <LANES >: SupportedLaneCount ,
209
- {
210
- type Output = Self ;
211
-
212
- #[ inline]
213
- fn div( self , rhs: $scalar) -> Self :: Output {
214
- if rhs == 0 {
215
- panic!( "attempt to divide by zero" ) ;
216
- }
217
- if <$scalar>:: MIN != 0 &&
218
- self . as_array( ) . iter( ) . any( |x| * x == <$scalar>:: MIN ) &&
219
- rhs == -1 as _ {
220
- panic!( "attempt to divide with overflow" ) ;
221
- }
222
- let rhs = Self :: splat( rhs) ;
223
- unsafe { intrinsics:: simd_div( self , rhs) }
224
- }
225
- }
226
- }
227
-
228
- impl_ref_ops! {
229
- impl <const LANES : usize > core:: ops:: Div <Simd <$scalar, LANES >> for $scalar
230
- where
231
- LaneCount <LANES >: SupportedLaneCount ,
232
- {
233
- type Output = Simd <$scalar, LANES >;
234
-
235
- #[ inline]
236
- fn div( self , rhs: Simd <$scalar, LANES >) -> Self :: Output {
237
- Simd :: splat( self ) / rhs
238
- }
239
- }
240
- }
241
-
242
177
// remainder panics on zero divisor
243
178
impl_ref_ops! {
244
179
impl <const LANES : usize > core:: ops:: Rem <Self > for Simd <$scalar, LANES >
@@ -268,43 +203,6 @@ macro_rules! impl_unsigned_int_ops {
268
203
}
269
204
}
270
205
271
- impl_ref_ops! {
272
- impl <const LANES : usize > core:: ops:: Rem <$scalar> for Simd <$scalar, LANES >
273
- where
274
- LaneCount <LANES >: SupportedLaneCount ,
275
- {
276
- type Output = Self ;
277
-
278
- #[ inline]
279
- fn rem( self , rhs: $scalar) -> Self :: Output {
280
- if rhs == 0 {
281
- panic!( "attempt to calculate the remainder with a divisor of zero" ) ;
282
- }
283
- if <$scalar>:: MIN != 0 &&
284
- self . as_array( ) . iter( ) . any( |x| * x == <$scalar>:: MIN ) &&
285
- rhs == -1 as _ {
286
- panic!( "attempt to calculate the remainder with overflow" ) ;
287
- }
288
- let rhs = Self :: splat( rhs) ;
289
- unsafe { intrinsics:: simd_rem( self , rhs) }
290
- }
291
- }
292
- }
293
-
294
- impl_ref_ops! {
295
- impl <const LANES : usize > core:: ops:: Rem <Simd <$scalar, LANES >> for $scalar
296
- where
297
- LaneCount <LANES >: SupportedLaneCount ,
298
- {
299
- type Output = Simd <$scalar, LANES >;
300
-
301
- #[ inline]
302
- fn rem( self , rhs: Simd <$scalar, LANES >) -> Self :: Output {
303
- Simd :: splat( self ) % rhs
304
- }
305
- }
306
- }
307
-
308
206
// shifts panic on overflow
309
207
impl_ref_ops! {
310
208
impl <const LANES : usize > core:: ops:: Shl <Self > for Simd <$scalar, LANES >
@@ -328,24 +226,6 @@ macro_rules! impl_unsigned_int_ops {
328
226
}
329
227
}
330
228
331
- impl_ref_ops! {
332
- impl <const LANES : usize > core:: ops:: Shl <$scalar> for Simd <$scalar, LANES >
333
- where
334
- LaneCount <LANES >: SupportedLaneCount ,
335
- {
336
- type Output = Self ;
337
-
338
- #[ inline]
339
- fn shl( self , rhs: $scalar) -> Self :: Output {
340
- if invalid_shift_rhs( rhs) {
341
- panic!( "attempt to shift left with overflow" ) ;
342
- }
343
- let rhs = Self :: splat( rhs) ;
344
- unsafe { intrinsics:: simd_shl( self , rhs) }
345
- }
346
- }
347
- }
348
-
349
229
impl_ref_ops! {
350
230
impl <const LANES : usize > core:: ops:: Shr <Self > for Simd <$scalar, LANES >
351
231
where
@@ -367,24 +247,6 @@ macro_rules! impl_unsigned_int_ops {
367
247
}
368
248
}
369
249
}
370
-
371
- impl_ref_ops! {
372
- impl <const LANES : usize > core:: ops:: Shr <$scalar> for Simd <$scalar, LANES >
373
- where
374
- LaneCount <LANES >: SupportedLaneCount ,
375
- {
376
- type Output = Self ;
377
-
378
- #[ inline]
379
- fn shr( self , rhs: $scalar) -> Self :: Output {
380
- if invalid_shift_rhs( rhs) {
381
- panic!( "attempt to shift with overflow" ) ;
382
- }
383
- let rhs = Self :: splat( rhs) ;
384
- unsafe { intrinsics:: simd_shr( self , rhs) }
385
- }
386
- }
387
- }
388
250
) *
389
251
} ;
390
252
}
0 commit comments