2
2
//! Types representing
3
3
#![ allow( non_camel_case_types) ]
4
4
5
- use crate :: simd:: { LaneCount , Select , Simd , SimdCast , SimdElement , SupportedLaneCount } ;
5
+ use crate :: simd:: { Select , Simd , SimdCast , SimdElement } ;
6
6
use core:: cmp:: Ordering ;
7
7
use core:: { fmt, mem} ;
8
8
@@ -41,7 +41,6 @@ mod sealed {
41
41
pub trait Sealed {
42
42
fn valid < const N : usize > ( values : Simd < Self , N > ) -> bool
43
43
where
44
- LaneCount < N > : SupportedLaneCount ,
45
44
Self : SimdElement ;
46
45
47
46
fn eq ( self , other : Self ) -> bool ;
@@ -69,8 +68,6 @@ macro_rules! impl_element {
69
68
impl Sealed for $ty {
70
69
#[ inline]
71
70
fn valid<const N : usize >( value: Simd <Self , N >) -> bool
72
- where
73
- LaneCount <N >: SupportedLaneCount ,
74
71
{
75
72
// We can't use `Simd` directly, because `Simd`'s functions call this function and
76
73
// we will end up with an infinite loop.
@@ -124,20 +121,13 @@ impl_element! { isize, usize }
124
121
#[ repr( transparent) ]
125
122
pub struct Mask < T , const N : usize > ( Simd < T , N > )
126
123
where
127
- T : MaskElement ,
128
- LaneCount < N > : SupportedLaneCount ;
124
+ T : MaskElement ;
129
125
130
- impl < T , const N : usize > Copy for Mask < T , N >
131
- where
132
- T : MaskElement ,
133
- LaneCount < N > : SupportedLaneCount ,
134
- {
135
- }
126
+ impl < T , const N : usize > Copy for Mask < T , N > where T : MaskElement { }
136
127
137
128
impl < T , const N : usize > Clone for Mask < T , N >
138
129
where
139
130
T : MaskElement ,
140
- LaneCount < N > : SupportedLaneCount ,
141
131
{
142
132
#[ inline]
143
133
fn clone ( & self ) -> Self {
@@ -148,7 +138,6 @@ where
148
138
impl < T , const N : usize > Mask < T , N >
149
139
where
150
140
T : MaskElement ,
151
- LaneCount < N > : SupportedLaneCount ,
152
141
{
153
142
/// Constructs a mask by setting all elements to the given value.
154
143
#[ inline]
@@ -315,8 +304,6 @@ where
315
304
) -> U
316
305
where
317
306
T : MaskElement ,
318
- LaneCount < M > : SupportedLaneCount ,
319
- LaneCount < N > : SupportedLaneCount ,
320
307
{
321
308
let resized = mask. resize :: < M > ( false ) ;
322
309
@@ -421,7 +408,6 @@ where
421
408
impl < T , const N : usize > From < [ bool ; N ] > for Mask < T , N >
422
409
where
423
410
T : MaskElement ,
424
- LaneCount < N > : SupportedLaneCount ,
425
411
{
426
412
#[ inline]
427
413
fn from ( array : [ bool ; N ] ) -> Self {
@@ -432,7 +418,6 @@ where
432
418
impl < T , const N : usize > From < Mask < T , N > > for [ bool ; N ]
433
419
where
434
420
T : MaskElement ,
435
- LaneCount < N > : SupportedLaneCount ,
436
421
{
437
422
#[ inline]
438
423
fn from ( vector : Mask < T , N > ) -> Self {
@@ -443,7 +428,6 @@ where
443
428
impl < T , const N : usize > Default for Mask < T , N >
444
429
where
445
430
T : MaskElement ,
446
- LaneCount < N > : SupportedLaneCount ,
447
431
{
448
432
#[ inline]
449
433
fn default ( ) -> Self {
@@ -454,7 +438,6 @@ where
454
438
impl < T , const N : usize > PartialEq for Mask < T , N >
455
439
where
456
440
T : MaskElement + PartialEq ,
457
- LaneCount < N > : SupportedLaneCount ,
458
441
{
459
442
#[ inline]
460
443
fn eq ( & self , other : & Self ) -> bool {
@@ -465,7 +448,6 @@ where
465
448
impl < T , const N : usize > PartialOrd for Mask < T , N >
466
449
where
467
450
T : MaskElement + PartialOrd ,
468
- LaneCount < N > : SupportedLaneCount ,
469
451
{
470
452
#[ inline]
471
453
fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
@@ -476,7 +458,6 @@ where
476
458
impl < T , const N : usize > fmt:: Debug for Mask < T , N >
477
459
where
478
460
T : MaskElement + fmt:: Debug ,
479
- LaneCount < N > : SupportedLaneCount ,
480
461
{
481
462
#[ inline]
482
463
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -489,7 +470,6 @@ where
489
470
impl < T , const N : usize > core:: ops:: BitAnd for Mask < T , N >
490
471
where
491
472
T : MaskElement ,
492
- LaneCount < N > : SupportedLaneCount ,
493
473
{
494
474
type Output = Self ;
495
475
#[ inline]
@@ -502,7 +482,6 @@ where
502
482
impl < T , const N : usize > core:: ops:: BitAnd < bool > for Mask < T , N >
503
483
where
504
484
T : MaskElement ,
505
- LaneCount < N > : SupportedLaneCount ,
506
485
{
507
486
type Output = Self ;
508
487
#[ inline]
@@ -514,7 +493,6 @@ where
514
493
impl < T , const N : usize > core:: ops:: BitAnd < Mask < T , N > > for bool
515
494
where
516
495
T : MaskElement ,
517
- LaneCount < N > : SupportedLaneCount ,
518
496
{
519
497
type Output = Mask < T , N > ;
520
498
#[ inline]
@@ -526,7 +504,6 @@ where
526
504
impl < T , const N : usize > core:: ops:: BitOr for Mask < T , N >
527
505
where
528
506
T : MaskElement ,
529
- LaneCount < N > : SupportedLaneCount ,
530
507
{
531
508
type Output = Self ;
532
509
#[ inline]
@@ -539,7 +516,6 @@ where
539
516
impl < T , const N : usize > core:: ops:: BitOr < bool > for Mask < T , N >
540
517
where
541
518
T : MaskElement ,
542
- LaneCount < N > : SupportedLaneCount ,
543
519
{
544
520
type Output = Self ;
545
521
#[ inline]
@@ -551,7 +527,6 @@ where
551
527
impl < T , const N : usize > core:: ops:: BitOr < Mask < T , N > > for bool
552
528
where
553
529
T : MaskElement ,
554
- LaneCount < N > : SupportedLaneCount ,
555
530
{
556
531
type Output = Mask < T , N > ;
557
532
#[ inline]
@@ -563,7 +538,6 @@ where
563
538
impl < T , const N : usize > core:: ops:: BitXor for Mask < T , N >
564
539
where
565
540
T : MaskElement ,
566
- LaneCount < N > : SupportedLaneCount ,
567
541
{
568
542
type Output = Self ;
569
543
#[ inline]
@@ -576,7 +550,6 @@ where
576
550
impl < T , const N : usize > core:: ops:: BitXor < bool > for Mask < T , N >
577
551
where
578
552
T : MaskElement ,
579
- LaneCount < N > : SupportedLaneCount ,
580
553
{
581
554
type Output = Self ;
582
555
#[ inline]
@@ -588,7 +561,6 @@ where
588
561
impl < T , const N : usize > core:: ops:: BitXor < Mask < T , N > > for bool
589
562
where
590
563
T : MaskElement ,
591
- LaneCount < N > : SupportedLaneCount ,
592
564
{
593
565
type Output = Mask < T , N > ;
594
566
#[ inline]
@@ -600,7 +572,6 @@ where
600
572
impl < T , const N : usize > core:: ops:: Not for Mask < T , N >
601
573
where
602
574
T : MaskElement ,
603
- LaneCount < N > : SupportedLaneCount ,
604
575
{
605
576
type Output = Mask < T , N > ;
606
577
#[ inline]
@@ -612,7 +583,6 @@ where
612
583
impl < T , const N : usize > core:: ops:: BitAndAssign for Mask < T , N >
613
584
where
614
585
T : MaskElement ,
615
- LaneCount < N > : SupportedLaneCount ,
616
586
{
617
587
#[ inline]
618
588
fn bitand_assign ( & mut self , rhs : Self ) {
@@ -623,7 +593,6 @@ where
623
593
impl < T , const N : usize > core:: ops:: BitAndAssign < bool > for Mask < T , N >
624
594
where
625
595
T : MaskElement ,
626
- LaneCount < N > : SupportedLaneCount ,
627
596
{
628
597
#[ inline]
629
598
fn bitand_assign ( & mut self , rhs : bool ) {
@@ -634,7 +603,6 @@ where
634
603
impl < T , const N : usize > core:: ops:: BitOrAssign for Mask < T , N >
635
604
where
636
605
T : MaskElement ,
637
- LaneCount < N > : SupportedLaneCount ,
638
606
{
639
607
#[ inline]
640
608
fn bitor_assign ( & mut self , rhs : Self ) {
@@ -645,7 +613,6 @@ where
645
613
impl < T , const N : usize > core:: ops:: BitOrAssign < bool > for Mask < T , N >
646
614
where
647
615
T : MaskElement ,
648
- LaneCount < N > : SupportedLaneCount ,
649
616
{
650
617
#[ inline]
651
618
fn bitor_assign ( & mut self , rhs : bool ) {
@@ -656,7 +623,6 @@ where
656
623
impl < T , const N : usize > core:: ops:: BitXorAssign for Mask < T , N >
657
624
where
658
625
T : MaskElement ,
659
- LaneCount < N > : SupportedLaneCount ,
660
626
{
661
627
#[ inline]
662
628
fn bitxor_assign ( & mut self , rhs : Self ) {
@@ -667,7 +633,6 @@ where
667
633
impl < T , const N : usize > core:: ops:: BitXorAssign < bool > for Mask < T , N >
668
634
where
669
635
T : MaskElement ,
670
- LaneCount < N > : SupportedLaneCount ,
671
636
{
672
637
#[ inline]
673
638
fn bitxor_assign ( & mut self , rhs : bool ) {
@@ -679,8 +644,6 @@ macro_rules! impl_from {
679
644
{ $from: ty => $( $to: ty) ,* } => {
680
645
$(
681
646
impl <const N : usize > From <Mask <$from, N >> for Mask <$to, N >
682
- where
683
- LaneCount <N >: SupportedLaneCount ,
684
647
{
685
648
#[ inline]
686
649
fn from( value: Mask <$from, N >) -> Self {
0 commit comments