You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 22, 2021. It is now read-only.
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.