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.

Remove "S.build" constructors #12

Description

@stoklund

The initial proposal in #1 includes S.build() constructors that create SIMD vectors from dynamic per-lane arguments:

  • b8x16.build(x: i32[16]) -> b8x16
  • b16x8.build(x: i32[8]) -> b16x8
  • b32x4.build(x: i32[4]) -> b32x4
  • b64x2.build(x: i32[2]) -> b64x2
  • i8x16.build(x: i32[16]) -> v128
  • i16x8.build(x: i32[8]) -> v128
  • i32x4.build(x: i32[4]) -> v128
  • i64x2.build(x: i64[2]) -> v128
  • f32x4.build(x: f32[4]) -> v128
  • f64x2.build(x: f64[2]) -> v128

@sunfishcode suggested that they are redundant since you can use replace_lane instead to insert one lane at a time, starting from some v128.const.

Prior art

LLVM IR does not have vector constructors like these. The convention is to begin from an undef of the right type and insert one lane at a time with the insertelement instruction.

LLVM's SelectionDAG code generator will pattern-match the long sequences of insertelement instructions and transform them into an ISD::BUILD_VECTOR node which looks more like the build instructions in the proposal.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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