This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Gate unimplemented SIMD ops on flag
ClosedPublic

Authored by tlively on Dec 19 2018, 3:06 PM.

Details

Summary

Gates v128.const, f32x4.sqrt, f32x4.div, i8x16.extract_lane_u, and
i16x8.extract_lane_u on the --wasm-enable-unimplemented-simd flag,
since these ops are not implemented yet in V8.

Diff Detail

Repository
rL LLVM

Event Timeline

tlively created this revision.Dec 19 2018, 3:06 PM

Looks like it is not easy to only guard f32x4 type in td files in the current implementation. If we make sure we expand them in ISel, do we need a separate guard for td files?

lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
731 ↗(On Diff #178973)

Doesn't this guard both f32x4.sqrt and f64x2.sqrt?

755 ↗(On Diff #178973)

Doesn't this guard both f32x4.div and f64x2.div?

tlively marked 2 inline comments as done.Dec 19 2018, 3:57 PM

Looks like it is not easy to only guard f32x4 type in td files in the current implementation. If we make sure we expand them in ISel, do we need a separate guard for td files?

Yes, unfortunately. FastISel will emit f32x4.div and f32x4.sqrt unless we have the predicates in the td files, and instruction selection will fail unless we explicitly expand these ops in WebAssemblyISelLowering.cpp, so we need both. An alternative is to add logic FastISel to bail whenever it sees any SIMD, which would probably also be fine.

lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
731 ↗(On Diff #178973)

Yes, but that's ok because f64x2.sqrt is also not implemented in v8. All f64x2 and i64x2 ops are already gated on this flag prior to this CL.

755 ↗(On Diff #178973)

same here.

aheejin accepted this revision.Dec 19 2018, 4:09 PM
This revision is now accepted and ready to land.Dec 19 2018, 4:09 PM
This revision was automatically updated to reflect the committed changes.