Skip to content

Do we need polynomial scalar types for Arm NEON? #940

Closed
@AdamHillier

Description

@AdamHillier

For the Arm NEON polynomial vector types, stdarch currently uses a struct of unsigned integers, e.g.:

/// ARM-specific 64-bit wide polynomial vector of eight packed `u8`.
pub struct poly8x8_t(u8, u8, u8, u8, u8, u8, u8, u8);

However, there is no dedicated polynomial scalar type. arm_neon.h defines some polynomial scalar types such as poly8_t and poly16_t, which are then used as arguments or return types for some NEON intrinsics, e.g. vld1_lane_p8, vld1_dup_p16, vdup_n_p8, vget_lane_p16.

Clang typedefspoly8_t/poly16_t to uint8_t/uint16_t on Aarch64 and int8_t/int16_t otherwise (see here).

I have a local branch where I've added all of the vld1_dup_${type} intrinsics, and used u8/u16 instead of the polynomial scalar types where necessary. However, the stdarch-verify tests then fail because they complain that the type signature doesn't match the one given in the Arm documentation (which uses poly8_t/poly16_t). So, for now, not having polynomial scalar types blocks full implementation of all Neon intrinsics (unless the signature verification tests are modified).

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