Skip to content

ld1 inserts an alignment requirement #2198

Description

@awxkee

Current implementations of ld1 { vN.d }[N] insert an alignment requirement in debug builds, since a pointer dereference assumes the element is aligned to its type's size, whereas to the best of my knowledge, ld1 doesn't have any particular alignment requirements.

pub unsafe fn vld1q_lane_u32<const LANE: i32>(ptr: *const u32, src: uint32x4_t) -> uint32x4_t {
    static_assert_uimm_bits!(LANE, 2);
    simd_insert!(src, LANE as u32, *ptr)
}

pub unsafe fn vld1q_lane_u64<const LANE: i32>(ptr: *const u64, src: uint64x2_t) -> uint64x2_t {
    static_assert_uimm_bits!(LANE, 1);
    simd_insert!(src, LANE as u32, *ptr)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions