Skip to content

Common APIs for arithmetic shift #223

@uvvpavel

Description

@uvvpavel

With the vx4b architecture the arithmetic right-shift becomes less trivial as rsa instruction does not accommodate the case when shifting for more then the length of the word (undefined behaviour by the C standard). PR #222 adds a new API called ashr32_sat, trying to come up with the most generic arithmetic shift (with flooring when shifting right and saturations when shifting left). The API is partially tested by the higher-level APIs that use it but it needs to be tested on its own. Thinking about it, there's a need for the s16 (and maybe s64) variants. Would probably have to be moved into the scalar APIs and called something like s32_shr or s32_ashr and reimplemented fully in assembly.

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