[PATCH] D55904: [WebAssembly] Gate unimplemented SIMD ops on flag

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 15:57:35 PST 2018


tlively marked 2 inline comments as done.
tlively added a comment.

In D55904#1336977 <https://reviews.llvm.org/D55904#1336977>, @aheejin wrote:

> 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.



================
Comment at: lib/Target/WebAssembly/WebAssemblyInstrSIMD.td:731
 // Square root: sqrt
+let Predicates = [HasSIMD128, HasUnimplementedSIMD] in
 defm SQRT : SIMDUnaryFP<fsqrt, "sqrt", 151>;
----------------
aheejin wrote:
> Doesn't this guard both `f32x4.sqrt` and `f64x2.sqrt`?
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.


================
Comment at: lib/Target/WebAssembly/WebAssemblyInstrSIMD.td:755
 // Division: div
+let Predicates = [HasSIMD128, HasUnimplementedSIMD] in
 defm DIV : SIMDBinaryFP<fdiv, "div", 157>;
----------------
aheejin wrote:
> Doesn't this guard both `f32x4.div` and `f64x2.div`?
same here.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55904/new/

https://reviews.llvm.org/D55904





More information about the llvm-commits mailing list