Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Add opcodes for converting between integer vectors of different lane size. #21

@billbudge

Description

@billbudge

Integer conversions are useful when data is stored in a small integer format, but calculations are performed at a higher precision. They allow data to be unpacked and packed. Synthesizing these with opcodes in the spec is awkward. They are well supported on all architectures.

Widening conversions, with signed or unsigned saturation. These are unary operations, converting low or high half of the smaller lane vector in order to avoid multiple return values.

i32x4.SConvertI16x8Low(x: v128) -> v128
i32x4.SConvertI16x8High(x: v128) -> v128
i32x4.UConvertI16x8Low(x: v128) -> v128
i32x4.UConvertI16x8High(x: v128) -> v128

i16x8.SConvert8x16Low(x: v128) -> v128
i16x8.SConvert8x16High(x: v128) -> v128
i16x8.UConvert8x16Low(x: v128) -> v128
i16x8.UConvert8x16High(x: v128) -> v128

Narrowing conversions, signed and unsigned. These are binary operations, converting two input vectors into a single smaller lane vector.

i16x8.SConvertI32x4(x: v128, y:v128) -> v128
i16x8.UConvertI32x4(x: v128, y:v128) -> v128

i8x16.SConvertI16x8(x: v128, y:v128) -> v128
i8x16.UConvertI16x8(x: v128, y:v128) -> v128

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