[all-commits] [llvm/llvm-project] 1e9c39: [WebAssembly] Use functions instead of macros for ...

Thomas Lively via All-commits all-commits at lists.llvm.org
Fri May 7 11:50:43 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e9c39a3f982fe2f50cd19c74be8b64dfba4baad
      https://github.com/llvm/llvm-project/commit/1e9c39a3f982fe2f50cd19c74be8b64dfba4baad
  Author: Thomas Lively <tlively at google.com>
  Date:   2021-05-07 (Fri, 07 May 2021)

  Changed paths:
    M clang/lib/Headers/wasm_simd128.h
    M clang/test/Headers/wasm.c

  Log Message:
  -----------
  [WebAssembly] Use functions instead of macros for const SIMD intrinsics

To improve hygiene, consistency, and usability, it would be good to replace all
the macro intrinsics in wasm_simd128.h with functions. The reason for using
macros in the first place was to enforce the use of constants for some arguments
using `_Static_assert` with `__builtin_constant_p`. This commit switches to
using functions and uses the `__diagnose_if__` attribute rather than
`_Static_assert` to enforce constantness.

The remaining macro intrinsics cannot be made into functions until the builtin
functions they are implemented with can be replaced with normal code patterns
because the builtin functions themselves require that their arguments are
constants.

This commit also fixes a bug with the const_splat intrinsics in which the f32x4
and f64x2 variants were incorrectly producing integer vectors.

Differential Revision: https://reviews.llvm.org/D102018




More information about the All-commits mailing list