Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions fearless_simd/src/transmute.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
// Copyright 2026 the Fearless_SIMD Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! We have bytemuck at home
//! Safe wrappers for SIMD loads/stores and reference casts.
//!
//! This all serves a small set of checked transmute and cast functions;
//! if we find this growing in complexity we should probably just use the real bytemuck
//! This fulfills the purpose of both `safe_unaligned_simd` and `bytemuck` crates.
//! The implementation is bytemuck-like, but far smaller than either of those crates,
//! mostly by virtue of supporting less features (e.g. no by-value transmute).
//!
//! Unlike bytemuck, this verifies that sizes match at compile time,
//! so we won't accidentally ship always-panicking code even if it's not covered by tests.
Comment on lines +10 to +11

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I noted in #232, with bytemuck's 'must' functionality, this isn't really the case.

//!
//! It's not possible to get rid of `unsafe` here entirely, even if we were to use external crates,
//! because we need to implement Pod for wrappers like Aligned512 which cannot be safely derived.

use core::mem::{align_of, size_of};

Expand Down
Loading