[PATCH] D52372: [WebAssembly] SIMD conversions

Dan Gohman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 17:20:51 PDT 2018


sunfish added a comment.

In https://reviews.llvm.org/D52372#1244158, @aheejin wrote:

> 1. Is it correct to translate those llvm instructions to saturating versions of wasm instructions? For example, for scalars, we had a patch <https://github.com/llvm-mirror/llvm/commit/9f86840c1ccefbede8c0deeac9bb4f1a28608fc4> that implemented the saturating behavior. Don't we need a similar thing for vectors too?


No: the extra lowering code in that patch is needed when using the trapping forms (which is what MVP wasm has). When -mnontrapping-fptoint is specified, the non-trapping forms are used, which don't need extra lowering code. For SIMD the plan is that we'll only have the saturating forms, so it doesn't need the extra lowering code.

> 2. Is this behavior also dependent on `nontrapping-fptoint` <https://github.com/llvm-mirror/llvm/blob/59895038204bec7cb4f924acf25b91f3056ea492/lib/Target/WebAssembly/WebAssembly.td#L30-L33> feature, as the scalar instructions <https://github.com/llvm-mirror/llvm/blob/59895038204bec7cb4f924acf25b91f3056ea492/lib/Target/WebAssembly/WebAssemblyInstrConv.td#L63-L104>?

No, I don't think we need to do that. We need a flag for scalar because wasm MVP only has the trapping forms, but for SIMD, the plan is to only have the saturating ones, so I think it's safe to assume that if the subtarget has SIMD, it includes those.


Repository:
  rL LLVM

https://reviews.llvm.org/D52372





More information about the llvm-commits mailing list