File tree 7 files changed +660
-72
lines changed 7 files changed +660
-72
lines changed Original file line number Diff line number Diff line change @@ -5,37 +5,15 @@ macro_rules! impl_mask_reductions {
5
5
( $id: ident) => {
6
6
impl $id {
7
7
/// Are `all` vector lanes `true`?
8
- #[ cfg( not( target_arch = "aarch64" ) ) ]
9
8
#[ inline]
10
9
pub fn all( self ) -> bool {
11
- use coresimd:: simd_llvm:: simd_reduce_all;
12
- unsafe { simd_reduce_all( self ) }
10
+ unsafe { super :: codegen:: masks_reductions:: All :: all( self ) }
13
11
}
14
- /// Are `all` vector lanes `true`?
15
- #[ cfg( target_arch = "aarch64" ) ]
16
- #[ inline]
17
- pub fn all( self ) -> bool {
18
- // FIXME: Broken on AArch64
19
- // https://bugs.llvm.org/show_bug.cgi?id=36796
20
- self . and( )
21
- }
22
-
23
12
/// Is `any` vector lanes `true`?
24
- #[ cfg( not( target_arch = "aarch64" ) ) ]
25
13
#[ inline]
26
14
pub fn any( self ) -> bool {
27
- use coresimd:: simd_llvm:: simd_reduce_any;
28
- unsafe { simd_reduce_any( self ) }
15
+ unsafe { super :: codegen:: masks_reductions:: Any :: any( self ) }
29
16
}
30
- /// Is `any` vector lanes `true`?
31
- #[ cfg( target_arch = "aarch64" ) ]
32
- #[ inline]
33
- pub fn any( self ) -> bool {
34
- // FIXME: Broken on AArch64
35
- // https://bugs.llvm.org/show_bug.cgi?id=36796
36
- self . or( )
37
- }
38
-
39
17
/// Are `all` vector lanes `false`?
40
18
#[ inline]
41
19
pub fn none( self ) -> bool {
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change
1
+ //! Work arounds for code generation issues
2
+
3
+ #[ cfg( target_arch = "aarch64" ) ]
4
+ pub mod wrapping;
5
+
6
+ pub mod masks_reductions;
Original file line number Diff line number Diff line change
1
+ //! Used by the wrapping_sum and wrapping_product algorithms for AArch64.
2
+
3
+ pub ( crate ) trait Wrapping {
4
+ fn add ( self , other : Self ) -> Self ;
5
+ fn mul ( self , other : Self ) -> Self ;
6
+ }
7
+
8
+ macro_rules! int_impl {
9
+ ( $id: ident) => {
10
+ impl Wrapping for $id {
11
+ fn add( self , other: Self ) -> Self {
12
+ self . wrapping_add( other)
13
+ }
14
+ fn mul( self , other: Self ) -> Self {
15
+ self . wrapping_mul( other)
16
+ }
17
+ }
18
+ } ;
19
+ }
20
+ int_impl ! ( i8 ) ;
21
+ int_impl ! ( i16 ) ;
22
+ int_impl ! ( i32 ) ;
23
+ int_impl ! ( i64 ) ;
24
+ int_impl ! ( u8 ) ;
25
+ int_impl ! ( u16 ) ;
26
+ int_impl ! ( u32 ) ;
27
+ int_impl ! ( u64 ) ;
28
+
29
+ macro_rules! float_impl {
30
+ ( $id: ident) => {
31
+ impl Wrapping for $id {
32
+ fn add( self , other: Self ) -> Self {
33
+ self + other
34
+ }
35
+ fn mul( self , other: Self ) -> Self {
36
+ self * other
37
+ }
38
+ }
39
+ } ;
40
+ }
41
+ float_impl ! ( f32 ) ;
42
+ float_impl ! ( f64 ) ;
Original file line number Diff line number Diff line change @@ -80,51 +80,5 @@ impl<T> FromBits<T> for T {
80
80
}
81
81
}
82
82
83
- /// Workarounds code generation issues.
84
- #[ cfg( target_arch = "aarch64" ) ]
85
- mod codegen {
86
- #[ cfg( target_arch = "aarch64" ) ]
87
- pub mod wrapping {
88
- pub trait Wrapping {
89
- fn add ( self , other : Self ) -> Self ;
90
- fn mul ( self , other : Self ) -> Self ;
91
- }
92
-
93
- macro_rules! int_impl {
94
- ( $id: ident) => {
95
- impl Wrapping for $id {
96
- fn add( self , other: Self ) -> Self {
97
- self . wrapping_add( other)
98
- }
99
- fn mul( self , other: Self ) -> Self {
100
- self . wrapping_mul( other)
101
- }
102
- }
103
- } ;
104
- }
105
- int_impl ! ( i8 ) ;
106
- int_impl ! ( i16 ) ;
107
- int_impl ! ( i32 ) ;
108
- int_impl ! ( i64 ) ;
109
- int_impl ! ( u8 ) ;
110
- int_impl ! ( u16 ) ;
111
- int_impl ! ( u32 ) ;
112
- int_impl ! ( u64 ) ;
113
-
114
- macro_rules! float_impl {
115
- ( $id: ident) => {
116
- impl Wrapping for $id {
117
- fn add( self , other: Self ) -> Self {
118
- self + other
119
- }
120
- fn mul( self , other: Self ) -> Self {
121
- self * other
122
- }
123
- }
124
- } ;
125
- }
126
- float_impl ! ( f32 ) ;
127
- float_impl ! ( f64 ) ;
128
- }
129
-
130
- }
83
+ /// Work arounds code generation issues.
84
+ mod codegen;
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ is-it-maintained-issue-resolution = { repository = "rust-lang-nursery/stdsimd" }
18
18
is-it-maintained-open-issues = { repository = " rust-lang-nursery/stdsimd" }
19
19
maintenance = { status = " experimental" }
20
20
21
+ [dependencies ]
22
+ cfg-if = " 0.1"
23
+
21
24
[dev-dependencies ]
22
25
stdsimd-test = { version = " 0.*" , path = " ../stdsimd-test" }
23
26
stdsimd = { version = " 0.0.3" , path = " ../stdsimd" }
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ extern crate stdsimd;
43
43
extern crate stdsimd_test;
44
44
#[ cfg( test) ]
45
45
extern crate test;
46
+ #[ macro_use]
47
+ extern crate cfg_if;
46
48
47
49
macro_rules! test_v16 {
48
50
( $item: item) => { } ;
You can’t perform that action at this time.
0 commit comments