[PATCH] D80164: [WebAssembly] Fix bug in custom shuffle combine

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 20:53:51 PDT 2020


tlively added a comment.

In D80164#2045666 <https://reviews.llvm.org/D80164#2045666>, @aheejin wrote:

> Sorry not sure if I understand... what my question was, why do we need to casts return values to `v128_t` at all? (I'm not very familiar with the header file) So for example, for `f32x4_splat`, can't we do just
>
>   static __inline__ __f32x4 __DEFAULT_FN_ATTRS wasm_f32x4_splat(float __a) {
>     return (__f32x4){__a, __a, __a, __a};
>   }
>
>
> instead of
>
>   static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_f32x4_splat(float __a) {
>     return (v128_t)(__f32x4){__a, __a, __a, __a};
>   }
>
>
> ? The same for all other intrinsics. Is there a reason that all intrinsic's return type should be `v128_t`?


Oh gotcha. This is just a design decision. The header originally had different user-facing types for the different lane interpretations, but after some feedback from some early users we decided to just expose a single `v128_t` type for users to worry about. Internally we still need to use all the different types just to get the compiler to emit the correct code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80164





More information about the llvm-commits mailing list