@@ -126,14 +126,14 @@ pub fn _mm_cmpistrm<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
126
126
/// multiple lines";
127
127
/// let needle = b"\r\n\t\0\0\0\0\0\0\0\0\0\0\0\0\0";
128
128
///
129
- /// let a = _mm_loadu_si128(needle.as_ptr() as *const _);
129
+ /// let a = unsafe { _mm_loadu_si128(needle.as_ptr() as *const _) } ;
130
130
/// let hop = 16;
131
131
/// let mut indexes = Vec::new();
132
132
///
133
133
/// // Chunk the haystack into 16 byte chunks and find
134
134
/// // the first "\r\n\t" in the chunk.
135
135
/// for (i, chunk) in haystack.chunks(hop).enumerate() {
136
- /// let b = _mm_loadu_si128(chunk.as_ptr() as *const _);
136
+ /// let b = unsafe { _mm_loadu_si128(chunk.as_ptr() as *const _) } ;
137
137
/// let idx = _mm_cmpistri(a, b, _SIDD_CMP_EQUAL_ORDERED);
138
138
/// if idx != 16 {
139
139
/// indexes.push((idx as usize) + (i * hop));
@@ -164,8 +164,8 @@ pub fn _mm_cmpistrm<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
164
164
/// let special_chars = b"!@#$%^&*()[]:;<>";
165
165
///
166
166
/// // Load the input
167
- /// let a = _mm_loadu_si128(special_chars.as_ptr() as *const _);
168
- /// let b = _mm_loadu_si128(password.as_ptr() as *const _);
167
+ /// let a = unsafe { _mm_loadu_si128(special_chars.as_ptr() as *const _) } ;
168
+ /// let b = unsafe { _mm_loadu_si128(password.as_ptr() as *const _) } ;
169
169
///
170
170
/// // Use _SIDD_CMP_EQUAL_ANY to find the index of any bytes in b
171
171
/// let idx = _mm_cmpistri(a.into(), b.into(), _SIDD_CMP_EQUAL_ANY);
@@ -196,11 +196,11 @@ pub fn _mm_cmpistrm<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
196
196
/// # #[target_feature(enable = "sse4.2")]
197
197
/// # unsafe fn worker() {
198
198
/// # let b = b":;<=>?@[\\]^_`abc";
199
- /// # let b = _mm_loadu_si128(b.as_ptr() as *const _);
199
+ /// # let b = unsafe { _mm_loadu_si128(b.as_ptr() as *const _) } ;
200
200
///
201
201
/// // Specify the ranges of values to be searched for [A-Za-z0-9].
202
202
/// let a = b"AZaz09\0\0\0\0\0\0\0\0\0\0";
203
- /// let a = _mm_loadu_si128(a.as_ptr() as *const _);
203
+ /// let a = unsafe { _mm_loadu_si128(a.as_ptr() as *const _) } ;
204
204
///
205
205
/// // Use _SIDD_CMP_RANGES to find the index of first byte in ranges.
206
206
/// // Which in this case will be the first alpha numeric byte found
@@ -236,8 +236,8 @@ pub fn _mm_cmpistrm<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
236
236
/// # '❤'.encode_utf16(&mut some_utf16_words);
237
237
/// # '𝕊'.encode_utf16(&mut more_utf16_words);
238
238
/// // Load the input
239
- /// let a = _mm_loadu_si128(some_utf16_words.as_ptr() as *const _);
240
- /// let b = _mm_loadu_si128(more_utf16_words.as_ptr() as *const _);
239
+ /// let a = unsafe { _mm_loadu_si128(some_utf16_words.as_ptr() as *const _) } ;
240
+ /// let b = unsafe { _mm_loadu_si128(more_utf16_words.as_ptr() as *const _) } ;
241
241
///
242
242
/// // Specify _SIDD_UWORD_OPS to compare words instead of bytes, and
243
243
/// // use _SIDD_CMP_EQUAL_EACH to compare the two strings.
@@ -404,8 +404,8 @@ pub fn _mm_cmpestrm<const IMM8: i32>(a: __m128i, la: i32, b: __m128i, lb: i32) -
404
404
/// // extra bytes we do not want to search for.
405
405
/// let needle = b"\r\n\t ignore this ";
406
406
///
407
- /// let a = _mm_loadu_si128(needle.as_ptr() as *const _);
408
- /// let b = _mm_loadu_si128(haystack.as_ptr() as *const _);
407
+ /// let a = unsafe { _mm_loadu_si128(needle.as_ptr() as *const _) } ;
408
+ /// let b = unsafe { _mm_loadu_si128(haystack.as_ptr() as *const _) } ;
409
409
///
410
410
/// // Note: We explicitly specify we only want to search `b` for the
411
411
/// // first 3 characters of a.
0 commit comments