MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / extract_lane_bytes

Method extract_lane_bytes

crates/tinywasm/src/interpreter/simd/utils.rs:7–14  ·  view source on GitHub ↗
(self, lane: u8, lane_count: u8)

Source from the content-addressed store, hash-verified

5
6impl Value128 {
7 pub(super) fn extract_lane_bytes<const LANE_BYTES: usize>(self, lane: u8, lane_count: u8) -> [u8; LANE_BYTES] {
8 debug_assert!(lane < lane_count);
9 let bytes = self.0;
10 let start = lane as usize * LANE_BYTES;
11 let mut out = [0u8; LANE_BYTES];
12 out.copy_from_slice(&bytes[start..start + LANE_BYTES]);
13 out
14 }
15
16 pub(super) fn replace_lane_bytes<const LANE_BYTES: usize>(
17 self,

Callers

nothing calls this directly

Calls 1

copy_from_sliceMethod · 0.45

Tested by

no test coverage detected