In the intel intrinsics guide, the signature is:
void _mm256_stream_si256 (__m256i * mem_addr, __m256i a)
but in Rust the signature is:
pub unsafe fn _mm256_stream_si256(mem_addr: *const __m256i, a: __m256i)
Note that the mem_addr pointer is const in Rust, but not in C. Since the only purpose of this function is to write through this pointer, it is probably unsound for it to take a const pointer.
EDIT: _mm256_stream_pd and _mm256_stream_ps also have this same issue. The SSE _mm_stream_ps, _mm_stream_pd, and _mm_stream_pi intrinsics correctly use *mut here.
A tangential bug is that the intrinsic verification failed hard here, since the C intrinsics do not use const pointers, it would have been safer to require these intrinsics to use mut pointers.
In the intel intrinsics guide, the signature is:
but in Rust the signature is:
Note that the
mem_addrpointer isconstin Rust, but not in C. Since the only purpose of this function is to write through this pointer, it is probably unsound for it to take aconstpointer.EDIT:
_mm256_stream_pdand_mm256_stream_psalso have this same issue. The SSE_mm_stream_ps,_mm_stream_pd, and_mm_stream_piintrinsics correctly use*muthere.A tangential bug is that the intrinsic verification failed hard here, since the C intrinsics do not use
constpointers, it would have been safer to require these intrinsics to usemutpointers.