@@ -16,7 +16,9 @@ pub trait SimdInt: Copy + Sealed {
16
16
/// # Examples
17
17
/// ```
18
18
/// # #![feature(portable_simd)]
19
- /// # use core::simd::Simd;
19
+ /// # #[cfg(feature = "as_crate")] use core_simd::simd;
20
+ /// # #[cfg(not(feature = "as_crate"))] use core::simd;
21
+ /// # use simd::{Simd, SimdInt};
20
22
/// use core::i32::{MIN, MAX};
21
23
/// let x = Simd::from_array([MIN, 0, 1, MAX]);
22
24
/// let max = Simd::splat(MAX);
@@ -32,7 +34,9 @@ pub trait SimdInt: Copy + Sealed {
32
34
/// # Examples
33
35
/// ```
34
36
/// # #![feature(portable_simd)]
35
- /// # use core::simd::Simd;
37
+ /// # #[cfg(feature = "as_crate")] use core_simd::simd;
38
+ /// # #[cfg(not(feature = "as_crate"))] use core::simd;
39
+ /// # use simd::{Simd, SimdInt};
36
40
/// use core::i32::{MIN, MAX};
37
41
/// let x = Simd::from_array([MIN, -2, -1, MAX]);
38
42
/// let max = Simd::splat(MAX);
@@ -48,7 +52,9 @@ pub trait SimdInt: Copy + Sealed {
48
52
/// # Examples
49
53
/// ```
50
54
/// # #![feature(portable_simd)]
51
- /// # use core::simd::Simd;
55
+ /// # #[cfg(feature = "as_crate")] use core_simd::simd;
56
+ /// # #[cfg(not(feature = "as_crate"))] use core::simd;
57
+ /// # use simd::{Simd, SimdInt};
52
58
/// use core::i32::{MIN, MAX};
53
59
/// let xs = Simd::from_array([MIN, MIN +1, -5, 0]);
54
60
/// assert_eq!(xs.abs(), Simd::from_array([MIN, MAX, 5, 0]));
@@ -61,7 +67,9 @@ pub trait SimdInt: Copy + Sealed {
61
67
/// # Examples
62
68
/// ```
63
69
/// # #![feature(portable_simd)]
64
- /// # use core::simd::Simd;
70
+ /// # #[cfg(feature = "as_crate")] use core_simd::simd;
71
+ /// # #[cfg(not(feature = "as_crate"))] use core::simd;
72
+ /// # use simd::{Simd, SimdInt};
65
73
/// use core::i32::{MIN, MAX};
66
74
/// let xs = Simd::from_array([MIN, -2, 0, 3]);
67
75
/// let unsat = xs.abs();
@@ -77,7 +85,9 @@ pub trait SimdInt: Copy + Sealed {
77
85
/// # Examples
78
86
/// ```
79
87
/// # #![feature(portable_simd)]
80
- /// # use core::simd::Simd;
88
+ /// # #[cfg(feature = "as_crate")] use core_simd::simd;
89
+ /// # #[cfg(not(feature = "as_crate"))] use core::simd;
90
+ /// # use simd::{Simd, SimdInt};
81
91
/// use core::i32::{MIN, MAX};
82
92
/// let x = Simd::from_array([MIN, -2, 3, MAX]);
83
93
/// let unsat = -x;
@@ -105,7 +115,9 @@ pub trait SimdInt: Copy + Sealed {
105
115
///
106
116
/// ```
107
117
/// # #![feature(portable_simd)]
108
- /// # use core::simd::i32x4;
118
+ /// # #[cfg(feature = "as_crate")] use core_simd::simd;
119
+ /// # #[cfg(not(feature = "as_crate"))] use core::simd;
120
+ /// # use simd::{i32x4, SimdInt};
109
121
/// let v = i32x4::from_array([1, 2, 3, 4]);
110
122
/// assert_eq!(v.reduce_sum(), 10);
111
123
///
@@ -121,7 +133,9 @@ pub trait SimdInt: Copy + Sealed {
121
133
///
122
134
/// ```
123
135
/// # #![feature(portable_simd)]
124
- /// # use core::simd::i32x4;
136
+ /// # #[cfg(feature = "as_crate")] use core_simd::simd;
137
+ /// # #[cfg(not(feature = "as_crate"))] use core::simd;
138
+ /// # use simd::{i32x4, SimdInt};
125
139
/// let v = i32x4::from_array([1, 2, 3, 4]);
126
140
/// assert_eq!(v.reduce_product(), 24);
127
141
///
@@ -137,7 +151,9 @@ pub trait SimdInt: Copy + Sealed {
137
151
///
138
152
/// ```
139
153
/// # #![feature(portable_simd)]
140
- /// # use core::simd::i32x4;
154
+ /// # #[cfg(feature = "as_crate")] use core_simd::simd;
155
+ /// # #[cfg(not(feature = "as_crate"))] use core::simd;
156
+ /// # use simd::{i32x4, SimdInt};
141
157
/// let v = i32x4::from_array([1, 2, 3, 4]);
142
158
/// assert_eq!(v.reduce_max(), 4);
143
159
/// ```
@@ -149,7 +165,9 @@ pub trait SimdInt: Copy + Sealed {
149
165
///
150
166
/// ```
151
167
/// # #![feature(portable_simd)]
152
- /// # use core::simd::i32x4;
168
+ /// # #[cfg(feature = "as_crate")] use core_simd::simd;
169
+ /// # #[cfg(not(feature = "as_crate"))] use core::simd;
170
+ /// # use simd::{i32x4, SimdInt};
153
171
/// let v = i32x4::from_array([1, 2, 3, 4]);
154
172
/// assert_eq!(v.reduce_min(), 1);
155
173
/// ```
0 commit comments