Skip to content

arm neon vld1*x tests fail on arm hw due to misaligned pointers #1217

Closed
@hkratz

Description

@hkratz

vld1x intrinsics are compiled to have alignment requirements, e.g. the assembly emitted for:

pub unsafe fn vld1_f32_x2(a: *const f32) -> float32x2x2_t { ... }

is

<stdarch_test_shim_vld1_f32_x2_vld1>:
      f4200a9f        vld1.32 {d0-d1}, [r0 :64]
      e12fff1e        bx      lr

and requires ato be 64-bit aligned (denoted by the :64 in the assembly). Clang does the same AFAICS.

Two problems:

  1. The alignment requirements are neither documented in Rust nor obvious and aarch64 has no such requirements.
  2. Our tests do not pass properly aligned pointers. Execution of the test suite on real arm hardware causes bus errors.

Possible solutions:

  1. Relax the alignment requirements at a slight general performance loss. Haven't checked if this can be done easily.
  2. Document and maybe assert the requirements and fix the tests.

cc @SparrowLii

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